odin-bot-v2
odin-bot-v2 copied to clipboard
Context menu button, Ban Spammer
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
- Adds context menu button to ban spam user
- Logs the ban in the appropriate channel
- Sends the user a contact information of why they were banned, and how to contact us once they recover their account if DM is not set to private.
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
- [x] I have thoroughly read and understand The Odin Project Contributing Guide
- [x] The title of this PR follows the
location of change: brief description of change
format, e.g.Callbacks command: Update verbiage
- [x] The
Because
section summarizes the reason for this PR - [x] The
This PR
section has a bullet point list describing the changes in this PR - [x] If this PR addresses an open issue, it is linked in the
Issue
section - [x] If this PR adds new features or functionality, I have added new tests
- [x] If applicable, I have ensured all tests related to any command files included in this PR pass, and/or all snapshots are up to date