This bot automatically reacts to messages in a Discord server based on your configuration.
- Listens for messages in your Discord server.
- Automatically adds reactions to messages according to your setup.
- Clone this repository.
- Install dependencies:
pip install -r requirements.txt
- Copy
.env.example
to.env
and fill in your Discord bot token and guild ID.
- Python 3.8+
- Discord bot token
- Guild (server) ID
Edit the .env
file with your credentials:
DISCORD_TOKEN="your_discord_bot_token"
GUILD_ID="your_guild_id"
Start the bot with:
python main.py
!autoreact set @User <emoji> [#channel ...]
Sets an auto-reaction for a user. Optionally specify channels.- Example:
!autoreact set @User 👍 #general
- Example:
!autoreact remove @User
Removes auto-reaction for a specific user.- Example:
!autoreact remove @User
- Example:
!autoreact removeall
Removes all auto-react configurations.
-
The bot saves auto-reaction settings in a local file named
autoreact_data.json
. -
Changes made via commands are persisted automatically.
-
Data Structure:
The file stores a dictionary where each key is a user's Discord ID (as a string).
Each value is an object containing:channels
: a list of channel IDs (empty for all channels)emoji
: the emoji to react with
Example:
{ "123456789012345678": { "channels": [987654321098765432, 876543210987654321], "emoji": "\ud83d\udc4d" }, "234567890123456789": { "channels": [], "emoji": "<:syag:1399003920595947591>" } }