TheOdinProject / odin-bot-v2

The bot that breathes life into our Discord community
ISC License
48 stars 77 forks source link

Context menu button, Ban Spammer #548

Open Mclilzee opened 5 months ago

Mclilzee commented 5 months ago

Because

Phishing links spam is an ever-increasing occurrence on discord. The mod team have to keep banning these users with the same message so that they know how to contact us if they wish to rejoin the server.

This PR will automate that with a click of a button.

This PR

Issue

Closes #504

Additional Information

Make sure to change the config.js moderationLog ID to the channel ID of your test server to see the log messages while testing.

There are currently some duplication of functions in some of the other services, I think it would be a good idea to move those to utils. Another duplication happen is with the tests, There is a buildInteraction function in test utils but that one is made for a specific purpose only, I would need to change it and refactor all the tests that calls it in order to generalize it to be used by these new tests. I didn't want this PR to be too big and include those refactors. So I included some create interaction mocks functions in the test files.

Let me know how would you like to proceed with the refactors.

Pull Request Requirements

Mclilzee commented 4 months ago

@TheOdinProject/moderators I would like the mod team to weigh on this. What the message to the user would be like, what kind of template. And perhaps some kind of a form so that they can use for the appeal?

This is the current template of the message

Account is compromised and is used to spam phishing links.

If you would still like to continue using our server, make sure to change your password and recover your account. After that send a detailed contact information to appeal the ban on theodinprojectcontact@gmail.com

I would like to especially hear from @JustWaveThings since this was originally your idea, is this how you imagined it to be, or do you think it needs some improvements?

JustWaveThings commented 4 months ago

I'll be happy to put together a message to send on the ban. I will look at the functionality of it tonight. Thank you so much for doing this!

JustWaveThings commented 4 months ago

@Mclilzee, Here's my take on the message the bot could send:

This account has been banned from The Odin Project Discord server for sending spam. If this account is compromised, please follow the steps linked in this Discord support article to secure your account.

Once your account is secure, you may appeal your ban by emailing theodinprojectcontact@gmail.com with your Discord username and that you are appealing your ban due to a compromised account.

Note: It may take several days for our volunteer staff to take action on your appeal, and unbanning is not guaranteed.

I don't know if we need to get fancy with the message. I'm also fine with just sending what we send now in the ban message.

Mclilzee commented 4 months ago

@Mclilzee, Here's my take on the message the bot could send:

This account has been banned from The Odin Project Discord server for sending spam. If this account is compromised, please follow the steps linked in this Discord support article to secure your account.

Once your account is secure, you may appeal your ban by emailing theodinprojectcontact@gmail.com with your Discord username and that you are appealing your ban due to a compromised account.

Note: It may take several days for our volunteer staff to take action on your appeal, and unbanning is not guaranteed.

I don't know if we need to get fancy with the message. I'm also fine with just sending what we send now in the ban message.

This looks great! Thank you, Fred. This is much better than whatever I can cook with my broken English.

Asartea commented 4 months ago

Very minor nit, but I think that the starting This should also be an Your, otherwise you're switching between modes of address