Discord-Autobot
Discord-Autobot copied to clipboard
Auto chat/send image, leave, join discord server, delete, reply, reaction messages with AI.
π€ Discord Automation Bot by @MeoMunDep
π Overview
This bot automates interactions on Discord, including sending messages, joining/leaving servers, and handling messages using multiple accounts with proxy support.
π Features
- π¬ Auto Messaging β Sends messages to specified channels
- β Auto Join Servers β Joins servers using invite links
- β Auto Leave Servers β Leaves specified servers
- π Proxy Support β Supports HTTP(S) and SOCKS5 proxies
- ποΈ Auto Message Deletion β Deletes sent messages after a configurable delay
- π Multi-language Support β Configurable message language
- π Error Logging β Saves IDs of servers or channels where errors occurred
- π€ AI Replies β Generate casual responses using AI providers (Groq, OpenRouter, Gemini, Poe)
- πΌοΈ Image Generation β Generate and send AI images to channels using Freepik API
- ποΈ Server Control β Enable/disable individual servers without deleting configuration
π οΈ Installation
π Requirements
- Node.js
v22.11.0 - npm
v10.9.0
π¦ Download: Node.js & npm
π₯ Steps
-
Clone the repository:
git clone https://github.com/MeoMunDep/Discord-Autobot.git cd "discord-autobot" -
Install dependencies:
npm installβ οΈ If you see an Execution Policy error on Windows:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassThen rerun:
npm install -
Configure the bot: Edit the
configs.jsonfile to suit your preferences. -
Prepare input files:
- π
tokens.txtβ Discord tokens (one per line) - π
servers.jsonβ Server details including guild IDs, invite codes, and channel configurations (see detailed explanation below) - π
proxies.txtβ Proxies (optional) - π
messages.yamlβ Messages (multi-language) - ποΈ
error_channels.jsonβ Stores failed channels/servers (automatically generated/updated)
- π
π Helpful links:
βοΈ Configuration (configs.json)
| βοΈ Setting | π Description |
|---|---|
maxAccountsAtOnce |
Number of accounts to run at once |
delayBetweenAccounts |
Delay (in seconds) between each account start |
delayEachChannel |
Delay (in seconds) between messages in different channels |
delayEachChat |
Delay (in seconds) between messages in different chats |
timeToRestartAllAccounts |
Time (in seconds) to restart all accounts |
chat_language |
Language used for auto-generated messages |
auto_chat |
Enable/disable automatic chatting |
join_server |
Enable/disable auto server joining |
leave_server |
Enable/disable auto server leaving |
delete_message |
Enable/disable message deletion after sending |
enable_replies |
Enable/disable message replies |
enable_reactions |
Enable/disable reactions |
reaction_chance |
Probability (0β1) of reacting to a message |
enable_ai_replies |
Enable/disable AI-generated replies |
ai_providers.* |
API keys for AI providers (Groq, Gemini, Poe, OpenRouter) |
image_generation_providers.* |
API keys for Image AI providers (Freepik) |
π§Ύ Example configs.json
{
"maxAccountsAtOnce": 1,
"delay_between_accounts": 15,
"delay_each_channel": [5, 7],
"delay_each_chat": [10, 15],
"time_to_restart_all_accounts": 963,
"auto_chat": true,
"submit_x_url": false,
"delete_message": false,
"join_server": false,
"leave_server": false,
"enable_replies": true,
"ai_reply_chance": 0.7,
"enable_reactions": true,
"reaction_chance": 0.7,
"ai_providers": {
"poe": [""],
"groq": [""],
"gemini": [""],
"openrouter": [""]
},
"image_generation_providers": {
"freepik": [""]
},
"voice_chat": {
"enabled": true,
"server_id": "",
"channel_id": "",
"user_id": ""
}
}
ποΈ servers.json Structure (DETAILED GUIDE)
The servers.json file is the heart of your bot configuration. It defines which servers to interact with and what actions to perform in each channel.
π Basic Structure
The file should be a JSON array containing server objects. Each server represents a Discord server you want the bot to interact with.
[
{
"name": "Server Name",
"guild_id": "1234567890123456789",
"invite_id": "inviteCode",
"channels": { ... },
"enabled": true
}
]
π Field Explanations
1οΈβ£ name (String - Required)
- What it is: A friendly name for the server (for your reference only)
- Example:
"Curious","My Gaming Server","Crypto Community" - Purpose: Helps you identify servers in logs and configuration
2οΈβ£ guild_id (String - Required)
- What it is: The Discord server's unique ID
- How to get it: Follow this guide
- Example:
"1417067849926705235" - Purpose: Used for leaving servers when
leave_server: truein configs
3οΈβ£ invite_id (String - Required)
- What it is: The invite code for joining the server
- Example:
"altiuslabs"(from discord.gg/altiuslabs) - Special values:
""(empty string) - Don't join this server"none"- Don't join this server"unknown"- Don't join this server
- Purpose: Used for joining servers when
join_server: truein configs
4οΈβ£ enabled (Boolean - Required)
- What it is: Controls whether the bot processes this server
- Values:
true- Bot will process this server (send messages, join, etc.)false- Bot will skip this server completely
- Purpose: Allows you to temporarily disable servers without deleting their configuration
5οΈβ£ channels (Object - Required)
This is where you define what the bot does in each channel. It has three categories:
π¨οΈ Channel Types
π raw_chat - Text Messages
Send regular text messages to channels.
Format:
"raw_chat": {
"CHANNEL_ID": "MESSAGE_TO_SEND"
}
Special Values:
"__random_message"- Bot will use AI or random message from messages.yaml- Any specific text - Bot will send exactly this text (e.g.,
"gm","Hello!")
Example:
"raw_chat": {
"1417068171243815002": "__random_message",
"1417084328504197250": "gm",
"9876543210987654321": "Hello everyone!"
}
What happens:
- In channel
1417068171243815002: Bot sends AI-generated or random message - In channel
1417084328504197250: Bot sends "gm" - In channel
9876543210987654321: Bot sends "Hello everyone!"
π€ command_chat - Bot Commands
Send slash commands or bot commands to channels.
Format:
"command_chat": {
"CHANNEL_ID": "COMMAND_TO_EXECUTE"
}
Example:
"command_chat": {
"1234567890123456789": "/claim daily",
"9876543210987654321": "/rewards"
}
What happens:
- In channel
1234567890123456789: Bot executes/claim dailycommand - In channel
9876543210987654321: Bot executes/rewardscommand
Note: This feature requires the bot to be configured for the specific bot's command structure.
πΌοΈ image_chat - AI-Generated Images
Generate and send AI images to channels using Freepik API. Get Freepik API key from here: Link
Format:
"image_chat": {
"CHANNEL_ID": "IMAGE_GENERATION_PROMPT"
}
Example:
"image_chat": {
"1435601397591703675": "Curious browser",
"9876543210987654321": "Beautiful sunset over mountains",
"1111222233334444555": "Cyberpunk city at night"
}
What happens:
- In channel
1435601397591703675: Bot generates image with prompt "Curious browser" and sends it - In channel
9876543210987654321: Bot generates "Beautiful sunset over mountains" image - In channel
1111222233334444555: Bot generates "Cyberpunk city at night" image
Requirements:
- Must have
freepikAPI key configured inconfigs.json - If Freepik fails, bot automatically falls back to Pollinations.ai (free, no API key needed)
π Complete Example
[
{
"name": "Curious Community",
"guild_id": "1417067849926705235",
"invite_id": "curious",
"channels": {
"raw_chat": {
"1417068171243815002": "__random_message",
"1417084328504197250": "gcurious"
},
"command_chat": {
"1417068171243815003": "/daily claim"
},
"image_chat": {
"1435601397591703675": "Curious browser logo"
}
},
"enabled": true
},
{
"name": "Gaming Server",
"guild_id": "9876543210987654321",
"invite_id": "gaming123",
"channels": {
"raw_chat": {
"1111111111111111111": "gm",
"2222222222222222222": "__random_message"
},
"command_chat": {},
"image_chat": {}
},
"enabled": true
},
{
"name": "Disabled Server (Not Active)",
"guild_id": "5555555555555555555",
"invite_id": "oldserver",
"channels": {
"raw_chat": {
"3333333333333333333": "test message"
},
"command_chat": {},
"image_chat": {}
},
"enabled": false
}
]
βοΈ How Bot Processes Servers
- Read
servers.json- Loads all server configurations - Check
enabled- Skips servers withenabled: false - Join Server (if
join_server: truein configs) - Usesinvite_id - Process Channels (if
auto_chat: truein configs):- Processes
raw_chatchannels β Sends text messages - Processes
command_chatchannels β Executes commands - Processes
image_chatchannels β Generates and sends images
- Processes
- Leave Server (if
leave_server: truein configs) - Usesguild_id - Repeat for next server
π‘ Tips & Best Practices
β DO:
- Use descriptive names for servers to easily identify them
- Set
enabled: falseto temporarily disable servers without losing configuration - Leave channel categories empty
{}if not using them - Use
"__random_message"for more natural, varied conversations - Test with one server first before adding multiple servers
β DON'T:
- Don't delete server entries - use
enabled: falseinstead - Don't put channel IDs in quotes within objects (they're already strings)
- Don't forget commas between objects in arrays
- Don't use invalid JSON syntax (use a JSON validator if unsure)
π Finding Channel IDs
- Enable Developer Mode in Discord (Settings β Advanced β Developer Mode)
- Right-click on any channel
- Click "Copy Channel ID"
- Paste the ID into
servers.json
π Troubleshooting
| Problem | Solution |
|---|---|
| Bot skips server | Check enabled: true is set |
| Bot doesn't join server | Check invite_id is correct and join_server: true in configs |
| Bot doesn't send messages | Check channel IDs are correct and auto_chat: true in configs |
| Images not generating | Check Freepik API key in configs.json (or bot will use free Pollinations.ai) |
| JSON syntax error | Use a JSON validator like jsonlint.com |
βΆοΈ Usage
π Run the bot
node index_meomundep.js
β¬οΈ Update the bot
git pull
π How It Works
- Reads configuration from
configs.json - Logs in using provided tokens from
tokens.txt - Applies proxy per account (if available in
proxies.txt) - Processes each server from
servers.json:- β
Checks if server is
enabled: true - β Joins server (using
invite_id) ifjoin_server: true - π¬ Sends messages/commands/images to channels if
auto_chat: true - β Leaves server (using
guild_id) ifleave_server: true
- β
Checks if server is
- Logs every event with timestamps and colored output
- Waits for delays between actions (configurable)
- Repeats automatically after
timeToRestartAllAccountsseconds
π Logs and Timestamps
- Each log entry includes a timestamp
- Timestamp format follows
chat_languagesetting - Color-coded logs for easy reading:
- π’ Green - Success
- π΄ Red - Error
- π‘ Yellow - Warning
- π΅ Blue - Info
- π£ Purple - Processing
β οΈ Important Notes
- β Ensure all tokens are valid and have required permissions
- π Use proxies to avoid rate limits or bans (one proxy per token recommended)
- β±οΈ Tune delay settings carefully for larger account sets
- π Monitor logs for errors and adjust
servers.jsonaccordingly - π Keep your tokens and API keys private and secure
- π« Don't share your
tokens.txtfile with anyone - πΎ Bot automatically saves errors to
error_channels.jsonto avoid retrying failed channels
π Contact & Support
- π Support Me: Link 1 β’ Link 2
- π¬ Contact: @MeoMunDep
- π₯ Group: Join Group
- π’ Channel: Visit Channel
β οΈ Disclaimer
This project was created solely as a personal educational exercise.
It is not an official product, website, or service of any company or brand referenced in this repository.
The creator is not affiliated, associated, endorsed by, or connected with any such company or brand in any way.
The code is provided "as is" without any warranties or guarantees.
Certain parts of the source are intentionally obfuscated to protect personal research, custom logic, and implementation techniques developed during learning and experimentation.
Use this project responsibly and at your own risk.
Redistribution, resale, or commercial use of any part of this codeβwhether original or modifiedβis not permitted.
β¬οΈ Back to top