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

[Feature] Add channel specific message filter #8

Open
kaiwalyakoparkar opened this issue Jul 25, 2021 · 6 comments
Open

[Feature] Add channel specific message filter #8

kaiwalyakoparkar opened this issue Jul 25, 2021 · 6 comments

Comments

@kaiwalyakoparkar
Copy link
Contributor

Say suppose if a channel was created for sharing job opportunities. People tend to send irrelevant or spammy messages there (by mistake also) So the task is to build a system that will check specific keywords in a message like in this case [internship, job, intern], etc. If the message contains the keywords then only it will be sent to the channel else will be deleted.
This will confirm the purpose of the channel.

@github-actions
Copy link

Hello 👋, Thank you very much for raising an issue 🙌. The maintainers will get back to you soon for discussion over the issue!

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord Server- we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

@Cahllagerfeld
Copy link

I'd say you should first be sure how you want to get the black/whitelist with words.

  • These Wordlists need to stored in a database together with the channelID
  • Then you need the onMessage Event and check for the channel which the message got sent in
  • If there is a entry for the channelID in the database you have to get your wordlist
  • validate your message against the wordlist from the database

The keything here I believe is how you want to create your wordlist for allowed/disallowed words and how you want to get them into your db

@kaiwalyakoparkar
Copy link
Contributor Author

I guess we are not adding DB as of now. (We can always try but). The idea is like we will add a allow list and if the user message has any of the words from the allowlist we will do nothing but if there isn't any word matching we will delete that message. Also, this bot is dedicated to only 2 servers. Should we still go for DB?

@Cahllagerfeld
Copy link

It depends. When not using a database you cant add channels dynamically. You would probably have to hardcode your channelIds which I definitely wouldnt do, or store it in-memory. Storing it in-memory would mean that after a reboot all data is lost. I htink thats a thing you have to decide.

@kaiwalyakoparkar
Copy link
Contributor Author

Umm. You are correct. 🤔 I will get back to you on your dm's or here when I figure out what approach could be followed.

@kaiwalyakoparkar
Copy link
Contributor Author

kaiwalyakoparkar commented Jul 26, 2021

Hey @Cahllagerfeld your idea of DB was great. We will use DB for that. Let me know when you are free in my DM's then we can pair on it. As it's bit difficult for me alone

@Cahllagerfeld Cahllagerfeld mentioned this issue Jul 31, 2021
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.