Discord Self Bot for cleaning message history in a specific channel
Easily delete your own Discord messages from any channel (DM or guild) using this self-bot tool.
Works with your account's session Cookie and Authentication token header and supports optional filtering by message range.
- Delete your own message history in any Discord channel (DM or Guild)
- Customizable deletion speed
- Optional filtering with Start/End message IDs
- Python 3.10 or newer
requests
Python package- Your Discord Cookie, Authorization Token, and User ID
- The Channel ID (and optional Guild ID) to delete messages from
This script interfaces with Discord's public API endpoints using your account credentials.
It searches for messages authored by your user ID in a specified channel and deletes them one by one with a configurable delay.
Note: The script does not use the official Discord bot API, as it is meant to operate as a self-bot.
- Clone or download this repository.
- Run
history_cleaner.py
in a terminal:
python history_cleaner.py
- Follow the prompts:
- Enter your:
- Discord Cookie;
- Authorization Token;
- User ID.
- Enter the Channel ID;
- (Optional) Enter a Guild ID (for server channels, leave blank for DMs);
- (Optional) Enter Start and Stop Message IDs to define deletion range.
- Enter your:
- Start ID: The earliest message to begin searching from (not inclusive).
- Stop ID: The last message to stop searching at (not inclusive).
- This script only deletes messages authored by your account.
- Start and Stop IDs are optional, but useful for fine-grained control.
- Make sure you input accurate credentials and IDs, otherwise the requests will fail.
This self-bot is for personal and educational use only. It can delete your own message history in any Discord channel where you have permission. Be aware that self-bots violate Discord’s Terms of Service and using this may result in your account being banned. The creator is not responsible for any misuse or consequences resulting from the use of this tool.
A huge thank you in advance to anyone who would like to donate me a pizza Margherita :)