over 2 years ago
Detox aims to assist moderators who deal with toxicity and profanity by using Perspective API and blacklists, many customisable options.
Toxicity and profanity filter for Discord. This bot makes use of the Perspective API. Add exemptions to specific roles and channels and customise percentages per server to log, warn or delete messages. Detox also supports a blacklist system implemented with Regular Expressions.
This bot was made in a rush and should be considered unstable for production use. As the days go past I will attempt to improve it.
If you'd like to use the bot how it is, without customising it feel free to click here to invite it to your server.
It requires several permissions, the biggest being managing messages. You are free to remove any that you think are too dangerous. Note that the bot will not be able to function entirely if you do remove them.
.envand supply a Perspective API key, along with Discord Bot Token
When the bot joins a server you'll need to set the log channel before anything can happen. All commands are case insensitive. Arguments to them are not.
All commands excluding !SetToxChannel and !RemoveTox must be executed from the log channel.
Detox also features a blacklist system that uses regular expressions with the global and case-insensitive flags enabled. First the blacklist is checked then profanity is checked.
If a regular expression has a match on the message then the message is deleted and no warning or log is sent to the tox channel or user.
The profanity filter is not run against the message if a match from the blacklist checker is found.
It is important to note that exempt channels and exempt roles are still considered by the blacklist checker so if someone has a role that is exempt they are also exempt from triggering the blacklist checker.
Blacklist channels are the list of channels that are monitored for blacklisted messages. By default a channel does not get checked against the blacklist.
Sets the logging channel (and command channel) to use. Only an ADMINISTRATOR can execute this command. It may be executed from any channel. Use by mentioning a channel.
User> !settoxchannel #event_log
Bot> Set the log channel to 123456789
Removes all data related to the current server Detox is in. Detox will then attempt to leave the server by itself. Only an ADMINISTRATOR can execute this command. It may be executed from any channel.
Get a list of exempt channels that the bot will not inspect.
Bot> Exempt Channels:
test1 - ID: 6934300518562 test2 - ID: 6934300518563
Add a list of exempt channels by mentioning channels.
User> !addexemptchannels #test1 #test2 #test3
Bot> Successfully added 3 channel(s) to be exempted.
Remove a list of exempt channels by mentioning channels.
User> !removeexemptchannels #test1 #test2 #test3
Bot> Successfully removed 3 channel(s) from being exempt.
Get a list of exempt roles. A user with an exempt role will be unfiltered.
Bot> Exempt Roles:
Unfiltered - ID: 6934300518562 RudePerson - ID: 6934300518563
Add a list of exempt roles by mentioning roles.
User> !addexemptroles @test @test2
Bot> Successfully added 3 roles(s) to be exempted.
Remove a list of exempt roles by mentioning roles.
User> !removeexemptroles @test @test2
Bot> Successfully removed 3 roles(s) from being exempt.
Show a summary of the config for the current server.
Bot> Server Config Summary:
Warn in Channel Percentage: 85% Delete Message Percentage: 90% Log Percentage: 75% Delete Message on Detect: false DM User on Detect: false Profanity Check: true Toxicity Check: true Exempt: 3 channel(s), 1 role(s)
Set the percentage for an action:
Note that the bot will not warn if the delete percentage is reached, it will still log if the log percentage has been reached.
User> !setlogpercentage 85
Bot> Successfully set the log percentage to 85%
Set whether the toxicity or profanity check will occur.
User> !setprofanitycheck no thanks
Bot> Successfully set profanity check to false
Whether or not to delete the message if it exceeds the delete percentage. Deleting will log a message to the tox channel.
User> !setdeletemessage true
Bot> Successfully set delete message to true
Whether or not to DM the user when the message has been deleted. Requires delete message to be triggered in order to send a DM.
User> !setdmuser no
Bot> Successfully set DM user to false
Displays the blacklist.
Bot> Blacklisted Words/Regex:
Adds a regular expression (regex) to the blacklist. Regular expressions have the G and I flags when tested against messages.
User> !addblacklist bad[\w\s]+word
Bot> Successfully added the blacklisted word.
Removes a regular expression (regex) from the blacklist.
User> !removeblacklist bad[\w\s]+word
Bot> Successfully removed blacklisted word.
Displays blacklist-enabled channels. Channels in this list are monitored by the blacklist checker.
Bot> Blacklist Check Channels:
test123 - ID: 43525733337933 test1234 - ID: 693717688633334
Adds a list of channels to be monitored for blacklisted words/regexes.
User> !addblacklistchannels #test123 #test345
Bot> Successfully added 2 channel(s) to be blacklist checked.
Removes a list of channels from blacklist monitoring.
User> !removeblacklistchannels #test123 #test345
Bot> Successfully removed 2 channel(s) from being blacklist checked.
Reviews can be left only by registered users. All reviews are moderated by Top.gg moderators. Please make sure to check our guidelines before posting.