-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
You should discuss how you want to bring the forbidden words to the databse. Is it via command, are only admins with a specific role allowed to do that?, etc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I marked some important lines. Feel free to give your opinion on it.
@@ -1,3 +1,4 @@ | |||
{ | |||
"prefix": "cm!" | |||
"prefix": "cm!", | |||
"adminRole": "Moderators" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced a Admin-Role to make some commands only accessible to users with a specific role. This can be adjusted
@@ -0,0 +1,46 @@ | |||
const { Configuration } = require('../schemas/config'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the Logic for communicating with mongo to a Service Class
} | ||
let args = message.content.slice(prefix.length).trim().split(' '); | ||
args.shift(); | ||
args = args.map((el) => el.toLowerCase()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every argument is converted to lowercase, so the bot cant be joked by typing blacklisted words in caps or somehow other
@Cahllagerfeld Oh! nice spots and fixes. Yeah, I want the admin to be able to post any messages but others should not be able to send the message containing the forbidden words |
|
Feel free to text me if you have any question on how the system works |
Fixes Issue
closes #8
Changes proposed
Add Mongo Connection to the bot for storing Configurations.
Here comes all the changes proposed through this PR
Check List (Check all the boxes which are applicable)