eddiehubcommunity / eddiebot Goto Github PK
View Code? Open in Web Editor NEWInclusive words Discord bot (no more "hey guys")
Home Page: http://discord.eddiehub.org
License: MIT License
Inclusive words Discord bot (no more "hey guys")
Home Page: http://discord.eddiehub.org
License: MIT License
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 ๐.
Dependent on new DB #263
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"
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.
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!
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.
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.
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:
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:
Instead of hard-coding the <general channel ID>
, we could add an env. var like process.env.GENERAL_CHANNEL_ID
.
This is the initial card for this issue.
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
}
Currently using !
which is the same as NightBot
May be should use $
?
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.
Unless I am looking in the wrong place, we seem to be missing the code for the bot entirely.
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 ๐
EddieBot could send a notification minutes before a streaming begins, and could send a notification when streaming is in progress.
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
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?
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.
When a user types !stats
, a message should appear with the following data:
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
}
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.
May be
!bio My bio is ...
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?
This command will cause the bot to crash if someone does not run it correctly. We should check if the arg length is 2. If it is not we should send back a message telling them how to use the command correctly.
The code could use some comments for people who are maybe not as clear on what you're doing?
We could add the tech stack (languages and libs) we use, like:
Save key/value pairs
available keys:
$bio set {KEY} {VALUE}
$bio remove {key}
To get user info
$info {@USER}
returns something like
Bio: ...
Twitter: ...
Github: ...
...
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.
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 ๐.
Use the open source code of conduct
I was just reviewing the code here https://github.com/eddiejaoude/EddieBot/blob/master/src/help.ts but found it difficult to follow as there are no comments.
I know it's early days, so no pressure :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.