A self-hosted Discord bot
Small update December 28th, 2022: AutoClearChannel has been updated to version 1.0.6. This updates the app to .NET 6.0, and the new Discord API. Also allows for the new API-tokens. Otherwise no changes.
When updating to this version: Make sure you enable the Message-Content Intent on the Discord Developers panel.
I will still not make updates for AutoClearChannel.
CleanChat has reached End-Of-Life, and has been discontinued/'shut down' as of February 12th 2022.
Thanks to everyone who used CleanChat.
CleanChat is not available as a self-hosted service. CleanChat AutoClearChannel is however still available, but will not recieve software updates.
The hosting service has also been discontinued.
This website will stay online purely for archival reasons.
For more information about why CleanChat was discontinued, please refer to my Discord: https://discord.gg/QzGnuvy , or by reading the attached document.
CleanChat AutoClearChannel (ACC for short), is a simple self-hosted Discord bot which can automatically delete messages after a certain delay in a channel. It also includes a purge command for easily purging loads of messages really quickly. The bot itself is a replacement for the AutoClearChannel in CleanChat.
Here is a small tutorial video showing what AutoClearChannel can do, and how to make a server via the hosting service with no prior knowlegde of the bot.
The hosting service has been discontinued along with the hosting of CleanChat.
Follow the tutorial below, or refer to one of these 3rd party tutorials provided by community members.
- CleanChatAutoClearChannel in Docker by Rikj000: https://github.com/Rikj000/CleanChat-AutoClearChannel-Docker
- Setting up CleanChat AutoClearChannel self hosting on a linux VPS (Debian) by @General Louis#0616: https://discord.com/channels/388818688394133505/430383993570066471/941381542389878805 (posted in the Discord CleanChat Support Server [INVITE])
The bot is self-hosted meaning that you will have to host it yourself! There is also a paid hosting service for those who cannot host their own bot.
- Have .NET Core 6.0 installed on your server:
- Download the package: Downloads.
- Unzip the package on your computer.
- Go to the Discord Developer Portal and create a new application with a bot: https://discordapp.com/developers/applications
- You need to enable the Message-Content Intent!
config.jsonand fill in the config file. See Configuration for help.
- Run the executeable:
- PORTABLE: Run in commandline:
- PORTABLE: Run in commandline:
Download latest version:
Latest version is: 126.96.36.199
The WINDOWS build obviously only runs on Windows, but dosn't require .NET Core 6.0. The drawback is then that the filesize is a lot bigger.
The PORTABLE build runs on all systems, but requires .NET Core 6.0.
For Linux users, you can download a free auto-update-script that will keep the bot updated: https://pastebin.com/nZL0pvQP. Download and save as start.sh, and launch that when you run the server.
Old versions can be found here. All versions prior to 1.0.6 uses .NET 3.1 instead of .NET 6.0: https://share.alexandernorup.com/p/cleanchat-downloads.
ConfigurationThe bot is configured through the
config.jsonfile, placed in the same root directory as the executeable.
The config file looks like this:
Here's a table of all the properties in the file:
|bottoken||Discord Bot Token|| Your token from the Discord Developer Portal |
|statusText||string||What the bot will be apearing to be "playing"|
|outputJsonLog||boolean||If set to true, the log will be displayed in JSON format.|
Below you'll find a long list of commands. If you click on a command, you'll be taken to an explanation of that command, along with use cases for set command.
All commands needs to start with you tagging your bot.
This means you have to put @YourBotName#1234 in front of every command, before it works!
|autoclearchannel||Automatically clean your channels|
|status||Shows current settings|
|forcepublicreply||Answers to your commands in the channel instead of DM||purge||Mass-delete commands|
autoclearchannelBack to commands
This command can be used to automatically clear a channel after a specified time.
That means if you set it at 5 seconds, then the bot will delete every message after they have each spent 5 seconds in chat.
The delay is set in milliseconds or a "formatted time string"
"Formatted time strings" looks like this:
"2s" means "2 Seconds"
"5m1s" means "5 Minutes and 1 Second"
"10h6m10s" means "10 Hours, 6 Minutes and 10 seconds"
"2s500ms" means "2 Seconds and 500 Milliseconds"
So basically a number, and then a letter representing a time unit.
"ms" means "Milliseconds"
"s" means "Seconds"
"m" means "Minutes"
"h" means "Hours"
"d" means "Days"
If you want to remove a autoclearchannel again, you must set the deletion delay to 0.
@Bot autoclearchannel <#channel> <time in ms | formatted time string>Show/hide argument information
Example of used correctly:
@Bot autoclearchannel #channel 5s
statusBack to commands
Shows current configuration of the bot.
resetBack to commands
The bot forgets everything about your server.
Can be used if you want to start-over.
forcepublicreplyBack to commands
If enabled, the bot will always reply in chat, instead of in DM's.
This feature is useful if you don't want people on your server to be able to DM you, but you still want to use the bot.
@Bot forcepulicreply <true | false>Show/hide argument information
Example of used correctly:
@Bot forcepublicreply true
purgeBack to commands
Will delete set number of messages from chat.
You can only delete a maximum of 100 messages per command execution.
The bot will skip any pinned messages.
If a user is specefied, the bot will only delete messages sent by that user.
This command supports filters. The following filters are available:
|Deletes the message if it contains the <string>|
|Deletes the message if it starts with the <string>|
|Deletes the message if it ends with the <string>|
|Deletes the message if it has an image attached|
|Deletes the message if it does not have an image attached|
|Deletes the message if it matches the <regex> (Advanced)|
Note: The bot can only mass-delete messages that're under 14 days old. This is a limitation set by Discord, which I can't do anything about, even if I wanted.
@Bot purge <number> [user | filter] [filter]Show/hide argument information
Examples of used correctly:
@Bot purge 50
@Bot purge 25 @AlexanderNorup#4981
@Bot purge 25 contains:banana
Need more help?
Join the support server where you can ask the developer directly for help. Please understand that he may not help immediately, as the developer also has a real life. But stay on the server, and he will be sure to @mention you when he replies you.