Go Back
CleanChat-AutoClearChannel
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.
Dear everyone.
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.
Hosting
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.
Read more about the hosting service here
Install instructions:
- Have .NET Core 6.0 installed on your server:
- Windows: ONLY if using PORTABLE: [x64] or [x86] or [ARM] (Use x64 if you are not sure)
- Mac: [ARM] or [Intel x64]
- Linux: https://learn.microsoft.com/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website
- 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!
- Copy
config.json.sample
toconfig.json
and fill in the config file. See Configuration for help. - Run the executeable:
- PORTABLE: Run in commandline:
dotnet CleanChat-AutoClearChannel.dll
- WINDOWS:
CleanChat-AutoClearChannel.exe
- PORTABLE: Run in commandline:
Downloads
Download latest version:
Latest version is: 1.0.6.0
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.
Configuration
The bot is configured through theconfig.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:
Property | Value Type | Descrption |
---|---|---|
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. |

Usage
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!
Commands
AutoClearChannel | |
autoclearchannel | Automatically clean your channels |
status | Shows current settings |
reset | Resets settings |
forcepublicreply | Answers to your commands in the channel instead of DM | purge | Mass-delete commands |
autoclearchannel
Back to commandsAliases:
autoclearchat, acc
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.
Usage:
@Bot autoclearchannel <#channel> <time in ms | formatted time string>Show/hide argument information
Example of used correctly:
@Bot autoclearchannel #channel 5s
status
Back to commandsShows current configuration of the bot.
Usage:
@Bot status
reset
Back to commandsThe bot forgets everything about your server.
Can be used if you want to start-over.
Usage:
@Bot reset
forcepublicreply
Back to commandsAliases:
fpr
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.
Usage:
@Bot forcepulicreply <true | false>Show/hide argument information
Example of used correctly:
@Bot forcepublicreply true
purge
Back to commandsAliases:
p
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.
Filters:
This command supports filters. The following filters are available:
Filter | Usage | Description |
contains | contains:<string> | Deletes the message if it contains the <string> |
startswith | startswith:<string> | Deletes the message if it starts with the <string> |
endswith | endswith:<string> | Deletes the message if it ends with the <string> |
withimage | withimage | Deletes the message if it has an image attached |
withoutimage | withoutimage | Deletes the message if it does not have an image attached |
regex | regex:<regex> | 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.
Usage:
@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.