Sometimes, Discord Community Managers or Administrators wish to cleanup a Discord channel's messages due to certain circumstances such as toxicity, spamming, or trolling. This Discord bot intends to help this process by scanning all messages within a channel, removing those which contain any of the set (configurable) filtration words.
- Java 6+
- Download the latest released
.jar
from the releases page. - Move the downloaded
.jar
somewhere easy to find, such as within a folder on your Desktop. - Do not double-click the
.jar
file. Instead, do the following.- Open a command prompt.
- Navigate to the directory where you stored the
.jar
file by using the commandcd path/to/directory
. - Execute the
.jar
file by using the commandjava -jar discord-message-cleaner.jar
.
- For first startup or instances where a configuration file could not be found, one will be generated within the directory where the
.jar
file is located. The application will exit automatically to allow you the opportunity to edit it. See the section on "Configuration" for details. - Once you have modified the configuration file to your liking, execute the
.jar
file again (see above for a reminder as to what the command is). - The application will start cleaning up the target Discord channel.
The following fields can be found within the config.yml
file in the same directory where the .jar
file is located after first startup.
bot_token
- The token which allows the application to login as a Discord bot. See this guide on how to create and add a bot to your Discord server.- The bot account requires the following permissions:
Read Message History
,Manage Messages
, or alternatively, these can be set for an individual channel when the bot has joined the server.
- The bot account requires the following permissions:
guild_id
- The target guild ID (snowflake) which contains the channel to clean up.channel_id
- The target channel ID (snowflake) to clean up.cleanup_words
- A list of words where, if a message contains one, it will be marked for deletion. The provided words are not case case-sensitive.
This application is built using the following open-source dependencies. Much appreciated.