Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

feat: init mongo #58

Closed
wants to merge 3 commits into from
Closed

feat: init mongo #58

wants to merge 3 commits into from

Conversation

Cahllagerfeld
Copy link

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)

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

@Cahllagerfeld
Copy link
Author

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...

Copy link
Author

@Cahllagerfeld Cahllagerfeld left a 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"
Copy link
Author

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');
Copy link
Author

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());
Copy link
Author

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

@kaiwalyakoparkar kaiwalyakoparkar marked this pull request as ready for review August 1, 2021 12:58
@kaiwalyakoparkar kaiwalyakoparkar marked this pull request as draft August 1, 2021 15:05
@kaiwalyakoparkar
Copy link
Contributor

@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

@Cahllagerfeld
Copy link
Author

@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

  • Admins are allowed to post everything now
  • command for retrieving blacklist per channel

@Cahllagerfeld Cahllagerfeld marked this pull request as ready for review August 1, 2021 20:12
@Cahllagerfeld
Copy link
Author

Feel free to text me if you have any question on how the system works

@Cahllagerfeld Cahllagerfeld closed this by deleting the head repository Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add channel specific message filter
2 participants