Git Product home page Git Product logo

eddiebot's Introduction

EddieBot

The official EddieBot for the EddieHub Discord server. Join us at Discord today!

Features

  • Checking peoples' messages for inclusive language.

Eddie bit warning

Config / Secrets environment variables

Copy .env.example to .env and add your private information

Note: never commit this file, it is ignored by Git

DISCORD_TOKEN="<your-token>"
EDDIEBOT_MONGO_CONNECTION_STRING="<your-mongo-connection-string>"

Installation

1. Start by making a fork of the repository. Click on the "Fork" symbol at the top right corner.

2. Clone your new fork of the repository:

$ git clone [email protected]:EddieHubCommunity/EddieBot.git

note: recommended

GitHub CLI

$ gh repo clone EddieHubCommunity/EddieBot

HTTPS

$ git clone https://github.com/EddieHubCommunity/EddieBot.git

3. Set upstream command:

git remote add upstream https://github.com/EddieHubCommunity/EddieBot.git

4. Navigate to the new project directory:

cd EddieBot

5. Create a new branch:

git checkout -b <branch-name>

6. Sync your fork or a local repository with the origin repository:

  • In your forked repository click on "Fetch upstream"
  • Click "Fetch and merge".

Alternatively, Git CLI way to Sync forked repository with origin repository:

git fetch upstream
git merge upstream/main

7. Make your changes to the source code.

8. Stage your changes and commit:

git add <filename>
git commit -m "<your-commit-message>"

9. Push your local commits to the remote repository:

git push origin <branch-name>

10. Create a Pull Request!

11. Congratulations! You've made your first contribution to EddieBot! ๐Ÿ™Œ๐Ÿผ

Discord Docs

Running the app

$ npm ci

# development
$ npm run build
$ npm start

Running the tests

$ npm test

Support

EddieBot is an MIT-licensed open source project. It can grow thanks to the contributors and the community members. If you'd like to join them, feel free to make a pull request and we'll review it.

Stuck? Have any questions or comments? Join us on Discord and ask for help.

License

The EddieBot is licensed under the MIT license.

Thanks to all Contributors ๐Ÿ’ช

Thanks a lot for spending your time helping EddieBot grow. Thanks a lot! Keep rocking ๐Ÿป

Contributors

Our Pledge

We take participation in our community as a harassment-free experience for everyone and we pledge to act in ways to contribute to an open, welcoming, diverse and inclusive community.

If you have experienced or been made aware of unacceptable behaviour, please remember that you can report this. Read our Code of Conduct.

eddiebot's People

Contributors

adityaraute avatar allanregush avatar allcontributors[bot] avatar bolt04 avatar cahllagerfeld avatar chinmaymhatre avatar dependabot[bot] avatar eddiejaoude avatar eync avatar garretcharp avatar goluffyxd avatar kaiwalyakoparkar avatar kkhitesh avatar luckspt avatar mikeysan avatar mstanciu552 avatar naomi-lgbt avatar panquesito7 avatar prajwal0024 avatar prince1y avatar raisinten avatar ruth-ikegah avatar sarajaoude avatar schmelto avatar starlightknown avatar stemount avatar utkarsh299-tech avatar verma-kunal avatar vyvy-vi avatar xkrishguptaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eddiebot's Issues

High value reaction role not being applied correctly

Currently if a user gets reactions in the form of multiple different emotes they do not get the high value role once they reach a total of 5 reactions. They will only receive the role if they receive a total of 5 from the same exact reaction emote.

Related doc to this: https://discordjs.guide/popular-topics/reactions.html#listening-for-reactions-on-old-messages

console.log(`${reaction.count} user(s) have given the same reaction to this message!`);

Note how it says "given the same reaction to this message"

Feature: Add in command usage for the help commands

Since we are getting to where we are doing commands that require input as to how they run I think it would be a good idea to add in a usage of how the command is supposed to be run.

Example for the standup command:

export const usage = `${COMMAND_PREFIX}${triggers[0]} <yesterday's message> || <today's message>`

This would go inside the standup.ts file.

Then inside the help command we could add another line below the description and print this out, as well as use it to send back the correct usage if someone was to enter the command incorrectly.

Feature: Add a command to get server stats

When a user types !stats, a message should appear with the following data:

  • total users
  • total messages
  • total reactions

Proposed solution for total users

// inside case 'stats' on commands.ts
const memberCount = getServerMemberCount(message.client);

export function getServerMemberCount(client: Client) {
    const guildKey = process.env.DISCORD_SERVER_ID
    if (!guildKey) {
        console.error(`Missing env. variable DISCORD_SERVER_ID. Please configure that value.`)
        return 0
    }

    const guild = client.guilds.cache.get(guildKey)
    if (!guild) {
        console.error(`The guild with the configured DISCORD_SERVER_ID env. variable doesn't exist`)
        return 0
    }

    return guild.memberCount
}

Error handling

In case of an error getting the member count for the guild, we can return 0 or null and then don't show that field on the final message. This is something I'd like your opinions on.

I'd also like to hear your feedback @eddiejaoude, on a better way to get the server's guild and add a default maybe. I proposed a new env. variable in order for the bot to work for various discord servers. It just has to be configured first.

Here is the card for this feature.

Tighter GitHub and User integration

EddieBot may send a notification when Eddie's repository receives a new PR or a new commit. Maybe we could create a new channel on the discord server just to receive these notifications from github.

Add optional reason for role assignment

If a user is a certain role on the discord server, but they did not assign that role to themselves, that might confuse them. In cases where the bot assigns a role if a condition passes, we could also save that reason for the new user's role (on the DB perhaps).

This feature's goal is to let the user execute a command or mention the bot, that gives them that reason, for a given role.
E.g:
<command-prefix>role <user-name> <role-name>

or

@EddieBot why do I have the role: <role-name>?

If it's a mention, the user would have to use specific keywords like "why" and "role"

Let me know your thoughts on this ๐Ÿ˜€

Suggestion: Add All Contributors Table in README

Hi everyone ๐Ÿ‘‹,

I've recently come across the all-contributors spec and thought we could add it on EddieBot as well. I wasn't aware of this, even though I remember seeing these tables on some popular repos on GitHub ๐Ÿ˜….

The idea of recognizing the contributions of everyone in the community, even if the PR was small, is important in my opinion. So I wanted to create this issue and start the discussion with the rest of the contributors.

In terms of how to do this, I think @eddiejaoude can install the bot on this repository and then configure it. We can also update our CONTRIBUTING.md file with more information about this ๐Ÿ˜ƒ.

Where is the source

Unless I am looking in the wrong place, we seem to be missing the code for the bot entirely.

how to get a discord-token

I was reading the readme file and I got stuck right at the start thinking "how do I get a discord token?"
I know I could probably google it, but since you have been through the process already, do you think it would be helpful to include the steps required? It could be as simple as a link to the discord site only.

What do you think?

Notify `general` when new channel is created

Proposed solution

For this, I'd suggest adding a new event handler function and listen to the channelCreate:

client.on('channelCreate', notifyGeneralChannel)

The notifyGeneralChannel() function would be the event handler that sends a message to the general channel. The message thas is sent could be the following:
test general notification for new channel

Implementation

This function could be implemented with something like this:

export const notifyGeneralChannel = (channel: DMChannel | GuildChannel) => {
        const channelName = 'general';
	const generalChannel = channel.client.channels.cache.find(currentChannel => 
		currentChannel.id === '<general channel ID>'
	)
	if (!generalChannel)
		return console.error(`${channelName} channel not found`);
	
	if (generalChannel instanceof TextChannel) {
		const message = '...'
		generalChannel.send(message)
	}
}
  • To get the generalChannel object, we could use the id property or the name property. Although if we use the name property we are limiting ourselves in possible names, for example having emojis:
    imagem

  • Instead of hard-coding the <general channel ID>, we could add an env. var like process.env.GENERAL_CHANNEL_ID.

Note

This is the initial card for this issue.

Suggestion: Add dotenv easier env vars

Currently in order to run the bot locally you have to either edit your environment, or run the command:

DISCORD_TOKEN=<GET YOUR DISCORD TOKEN> GENERAL_CHANNEL_ID=<GET YOUR GENERAL CHANNEL ID> DISCORD_SERVER_ID=<YOUR SERVER_ID> npm run start:local

I believe in order to make this a little easier and not having to modify your environment it would be nice to add dotenv which allows you to create a .env file in your project with the variables.

It would look like so for the developer:

DISCORD_TOKEN=<GET YOUR DISCORD TOKEN>
GENERAL_CHANNEL_ID=<GET YOUR GENERAL CHANNEL ID>
DISCORD_SERVER_ID=<YOUR SERVER_ID>

Would also need to change the package.json start local command to be:

dotenv npm run build && node dist/index.js

Of course the .env would also need to be added to .gitignore as you do not want to release those out to the world.

Didn't want to just add it in with another commit. Was curious what you guys thought of this, or if there is another way you do it similar to this that maybe doesnt require another module?

Split out commands into their own files

I believe having commands separated out to their own files will make it a lot easier to add new commands when needed. With this I also think having a config file for setting things like a command prefix or the default embed with the footer would be nice.

Currently working on doing this and noticed most commits reference an issue so I am creating this so we have it.

Integrate Firebase database (firestore)

Firestore

server collection

{
   "totals": {
      "users": 123,
      "messages": 456,
      "reactions": 789
   }
}

users collection (document per user)

{
   // ... user's public details
   "roles": [ "regular" ],
   "totals": {
      "messages": 123,
      "reactionsReceived": 456,
      "reactionsSent": 789
   },
   "info": {
      "bio": "...",
      "twitter": "...",
      "youtube": "...",
   }
}

messages collection

{
   // ... message public details (including message)
   "user": { }, // user's public details
   "reactionsReceived": 456
}

Add support for YouTube

EddieBot could send a notification minutes before a streaming begins, and could send a notification when streaming is in progress.

Shout out users who have contributed to GitHub today (4pm check?) - user must set their GitHub username

dependent on #60

This feature seems really cool! I was thinking that maybe the bot runs a job (just a function) at a certain time, or after X time has passed (this could be configured). That job is responsible for handling that logic, some steps would be:

Read users collection and filter out users without a github username (this should be a field but we need to confirm on the DB schema)
Use GitHub API to make the HTTP requests necessary to know when the user last contributed. These links might be useful

#71 (comment)

Use Discord Gateway Intents for V2 of the bot

Hi everyone ๐Ÿ‘‹,

We might need to refactor the codebase to use gateway intents, until October 7th of this year. I saw a video announcing this, and luckily we already have the latest version of discord.js (version 12 supports intents).

I'm creating this issue just to get your opinions and as a warning, since the bot may stop working after that deadline.

Summary

It seems we have to declare the types of events we are interested in, so changing the code here:

// initial client with params
const client: Client = new Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });

This reduces network traffic since the library (discord.js) will only receive event messages on the WebSocket, for the intents we specified.

Let me know what you think ๐Ÿ˜ƒ.

Feature: Experience System & Level Up ๐Ÿ†

Idea

Since Eddie's channel is all about Open Source and making contributions, I think making an XP System on the bot would be a cool idea. This system could help motivate more people in contributing to Open Source, in any way possible! It doesn't have to be code, fixing spelling errors, or translating docs also adds value!

Goal

The goal is to incentivize people to contribute to open source projects or participate in a hackathon and publish the code publicly to get feedback. Every time someone made a contribution, they would earn XP points, and after earning X points, they would level up (kinda like bringing gamification to software ๐Ÿ˜„). Maybe they earn a new role or badge every time they level up.

Implementation notes

  • ๐Ÿ›ข We would probably need some data storage for this feature like a database. So that in the event of the bot crashing and needs to restart, we don't lose the experience points of all the server's members (since they were stored in memory).
  • โš”๏ธ We could have like weekly challenges, where an OSS (Open-Source Software) is chosen and we all try to contribute with PR's to it. Whether it is documentation, fixing typos or their issues, etc. Also, it could be cool to have like a poll to decide the OSS of the week/month, so that the whole community has a say in the decision.
  • ๐ŸŽฏ๐Ÿ“‹ We could also implement goals, maybe public and private goals that he can track the progress of. Once the user achieves his goal he earns bonus experience points. An example of a public goal could be "Make 2 contributions every day for 2 weeks".

We could keep everything simple for a first version, and keep iterating throughout time. Just some food for thought ๐Ÿ˜. I'd love to hear any opinions on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.