Skip to content

Latest commit

ย 

History

478 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– 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 with customizable delays
  • ๐Ÿ”— Submit Channel Management โ€” Dedicated X/Twitter post submission system
  • โž• 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, Grok)
  • ๐Ÿ–ผ๏ธ Image Generation โ€” Generate and send AI images to channels using Freepik API (with Pollinations.ai fallback)
  • ๐ŸŽ›๏ธ Server Control โ€” Enable/disable individual servers without deleting configuration
  • โš™๏ธ Dual Mode Operation โ€” Run in normal mode (full flow) or submit-only mode
  • ๐ŸŽฎ Voice Channel Support โ€” Join and maintain presence in voice channels
  • ๐Ÿ“Š Interactive Management โ€” Built-in CLI menu for server, delay, and error management
  • ๐Ÿš€ CLI Flags โ€” Override config settings with command-line arguments

๐Ÿ› ๏ธ Installation

๐Ÿ“‹ Requirements

  • Node.js v22.11.0
  • npm v10.9.0

๐Ÿ“ฆ Download: Node.js & npm


๐Ÿ“ฅ Steps

  1. Clone the repository:

    git clone https://github.com/MeoMunDep/Discord-Autobot.git
    cd "discord-autobot"
  2. Install dependencies:

    npm install

    โš ๏ธ If you see an Execution Policy error on Windows:

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

    Then rerun:

    npm install
  3. Configure the bot: Edit the configs.json file to suit your preferences.

  4. 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, one per token)
    • ๐Ÿ“œ messages.yaml โ€” Messages (multi-language)
    • ๐Ÿ—‚๏ธ error-channels.json โ€” Stores failed channels/servers (automatically generated/updated)

๐Ÿ“Œ Helpful links:

  • ๐Ÿ”‘ Get tokens: Here
  • ๐Ÿ’ฌ Get chat ID: Here
  • ๐Ÿ“ก Get channel/server ID: Here

โš™๏ธ Configuration (configs.json)
โš™๏ธ Setting ๐Ÿ“˜ Description
max_accounts_at_once Number of accounts to run simultaneously
delay_between_accounts Delay (in seconds) between each account start
delay_each_channel [min, max] delay range (in seconds) between different channels
delay_each_chat [min, max] delay range (in seconds) between messages in same channel
time_to_restart_all_accounts Time (in seconds) before restarting all accounts
chat_language Language used for auto-generated messages
ask_before_auto_chat Prompt user to choose mode (submit_only/normal) before each cycle
auto_chat Default mode: true = normal mode, false = submit_only mode
submit_x_url Enable/disable submission of X/Twitter URLs in regular channels
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 to messages
reaction_chance Probability (0โ€“1) of reacting to a message
enable_ai_replies Enable/disable AI-generated replies
ai_reply_chance Probability (0โ€“1) of using AI to reply
ai_providers.* API keys (arrays) for AI providers (Groq, Gemini, Poe, OpenRouter, Grok)
image_generation_providers.* API keys (arrays) for Image AI providers (Freepik)
voice_chat.enabled Enable/disable voice channel connection
voice_chat.server_id Guild ID for voice channel
voice_chat.channel_id Voice channel ID to join
voice_chat.user_id Your user ID for voice connection

๐Ÿงพ Example configs.json

{
  "max_accounts_at_once": 1,
  "delay_between_accounts": 15,
  "delay_each_channel": [5, 7],
  "delay_each_chat": [10, 15],
  "time_to_restart_all_accounts": 963,

  "ask_before_auto_chat": false,
  "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,
  
  "enable_ai_replies": true,
  "ai_providers": {
    "groq": ["gsk_xxxxxxxxxxxxxxxxxxxxx"],
    "openrouter": [
      "sk-or-v1-xxxxxxxxxxxxx",
      "sk-or-v1-yyyyyyyyyyyyy"
    ],
    "gemini": [
      "AIzaSyXXXXXXXXXXXXXXX",
      "AIzaSyYYYYYYYYYYYYYYY",
      "AIzaSyZZZZZZZZZZZZZZZ"
    ],
    "poe": [""],
    "grok": ["xai-xxxxxxxxxxxxxxxxxxxxx"]
  },

  "image_generation_providers": {
    "freepik": [
      "fpk_xxxxxxxxxxxxxxxxxxxxx",
      "fpk_yyyyyyyyyyyyyyyyyyyyy"
    ]
  },

  "voice_chat": {
    "enabled": false,
    "server_id": "",
    "channel_id": "",
    "user_id": ""
  }
}

๐Ÿ”‘ Multiple API Keys

The bot supports multiple API keys for each provider. It will randomly select one key from the array for each request:

"ai_providers": {
  "groq": ["key1", "key2", "key3"],
  "gemini": ["key1", "key2"]
}

This helps with:

  • Load balancing across multiple API accounts
  • Rate limit management by distributing requests
  • Reliability - if one key fails, others can be tried

๐Ÿ”‘ GROQ API Key

Create Key

๐Ÿ”‘ GROK API Key

Create Key

Note: Grok API uses OpenAI-compatible format. Get your API key from X.AI console.

๐Ÿ”‘ GEMINI API Key

Create Key

๐Ÿ”‘ OPENROUTER API Key

Create Key

๐Ÿ”‘ POE API Key

Create Key

๐Ÿ”‘ FREEPIK API Key

Create Key


๐Ÿ—‚๏ธ 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",
    "enabled": true,
    "channels": {
      "submit_chat": { ... },
      "raw_chat": { ... },
      "command_chat": { ... },
      "image_chat": { ... }
    }
  }
]

๐Ÿ”‘ 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: true in 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: true in 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 four categories:


๐Ÿ—จ๏ธ Channel Types

๐Ÿ”— submit_chat - X/Twitter Post Submissions (NEW!)

Purpose: Dedicated channel type for submitting X/Twitter post links with customizable delays.

Format:

"submit_chat": {
  "CHANNEL_ID": {
    "message": "https://x.com/yourpost",
    "delay": [6000, 12000]
  }
}

Fields:

  • message (String): The X/Twitter URL to submit
  • delay (Array): [min, max] cooldown in seconds before bot can post again in this channel
  • enabled (Boolean, Optional): Set to false to disable this specific channel without removing it

Example:

"submit_chat": {
  "1380138116505141288": {
    "message": "https://x.com/MeoMunDep/status/123456789",
    "delay": [6000, 12000]
  },
  "1441334930268225637": {
    "message": "https://x.com/CryptoProject/status/987654321",
    "delay": [3600, 7200],
    "enabled": false
  }
}

How it works:

  • Bot only processes these channels in submit-only mode or normal mode
  • Each channel has its own cooldown timer tracked independently
  • URLs are submitted exactly as provided
  • If submit_x_url: false in configs, X/Twitter URLs in regular channels are skipped

๐Ÿ“ raw_chat - Text Messages

Send regular text messages to channels.

Format (Simple):

"raw_chat": {
  "CHANNEL_ID": "MESSAGE_TO_SEND"
}

Format (Advanced with Options):

"raw_chat": {
  "CHANNEL_ID": {
    "message": "MESSAGE_TO_SEND",
    "delay": [60, 120],
    "enabled": true
  }
}

Special Values:

  • "__random_message" - Bot will use AI or random message from messages.yaml
  • "[AI] Your instruction" - Bot will use AI with your custom instruction
  • Any specific text - Bot will send exactly this text (e.g., "gm", "Hello!")

Example:

"raw_chat": {
  "1417068171243815002": {
    "message": "[AI] Respond to random messages",
    "delay": [60, 120]
  },
  "1417084328504197250": {
    "message": "gm",
    "delay": [6000, 12000]
  },
  "9876543210987654321": "__random_message"
}

What happens:

  • In channel 1417068171243815002: Bot uses AI with instruction "Respond to random messages"
  • In channel 1417084328504197250: Bot sends "gm" every 6000-12000 seconds
  • In channel 9876543210987654321: Bot sends random AI-generated message

๐Ÿค– command_chat - Bot Commands

Send slash commands or bot commands to channels.

Format:

"command_chat": {
  "CHANNEL_ID": {
    "command": "COMMAND_TO_EXECUTE",
    "delay": [60, 120]
  }
}

Example:

"command_chat": {
  "1234567890123456789": {
    "command": "/claim daily",
    "delay": [86400, 86500]
  },
  "9876543210987654321": {
    "command": "!rank",
    "delay": [600, 1200]
  }
}

๐Ÿ–ผ๏ธ image_chat - AI-Generated Images

Generate and send AI images to channels using Freepik API (with automatic Pollinations.ai fallback).

Format:

"image_chat": {
  "CHANNEL_ID": {
    "prompt": "IMAGE_GENERATION_PROMPT",
    "delay": [60, 120]
  }
}

Example:

"image_chat": {
  "1435601397591703675": {
    "prompt": "Airdrop project with 'Curious'",
    "delay": [7200, 10000]
  },
  "9876543210987654321": {
    "prompt": "Beautiful sunset over mountains",
    "delay": [3600, 7200]
  }
}

Requirements:

  • Must have freepik API key configured in configs.json
  • If Freepik fails or no API key, bot automatically uses Pollinations.ai (free, no API key needed)

๐Ÿ“‹ Complete Example

[
  {
    "name": "Curious",
    "guild_id": "1417067849926705235",
    "invite_id": "curious",
    "enabled": true,
    "channels": {
      "submit_chat": {
        "1417080821852147732": {
          "message": "https://x.com/Curious/status/123456",
          "delay": [6000, 12000]
        }
      },
      "raw_chat": {
        "1417068171243815002": {
          "message": "[AI] Respond to random messages",
          "delay": [60, 120]
        },
        "1417084328504197250": {
          "message": "gcurious",
          "delay": [600, 1200]
        }
      },
      "command_chat": {
        "1417068171243815003": {
          "command": "!rank",
          "delay": [600, 1200]
        }
      },
      "image_chat": {
        "1435601397591703675": {
          "prompt": "Airdrop project with 'CURIOUS'",
          "delay": [60, 120]
        }
      }
    }
  },
  {
    "name": "Disabled Server (Not Active)",
    "guild_id": "5555555555555555555",
    "invite_id": "oldserver",
    "enabled": false,
    "channels": {
      "submit_chat": {},
      "raw_chat": {
        "3333333333333333333": {
          "message": "test message",
          "delay": [60, 120]
        }
      },
      "command_chat": {},
      "image_chat": {}
    }
  }
]

โฑ๏ธ Delay System

The bot uses a smart cooldown system to prevent spam and rate limits:

๐Ÿ“Š Delay Priority (from highest to lowest):

  1. Channel-specific delay (in servers.json)

    "1234567890": {
      "message": "gm",
      "delay": [300, 600]  โ† This takes priority
    }
  2. Global delay_each_chat (in configs.json)

    "delay_each_chat": [10, 15]  โ† Fallback if channel has no delay

๐Ÿ”„ How it works:

  • Each channel has its own independent cooldown timer
  • Timer starts after successful message send
  • Bot checks if cooldown period has passed before sending next message
  • If cooldown active, bot skips channel and logs remaining wait time
  • Cooldowns are persistent and tracked in chat-timestamps.json

๐Ÿ’ก Tips:

  • Use longer delays (3600-7200s) for low-activity channels
  • Use shorter delays (60-300s) for high-engagement channels
  • Submit channels typically use 6000-12000s delays
  • Image generation should use longer delays (7200-10000s) due to API costs

๐Ÿ’ก Tips & Best Practices

โœ… DO:

  • Use descriptive names for servers to easily identify them
  • Set enabled: false to temporarily disable servers without losing configuration
  • Set enabled: false on individual channels to disable them
  • Use channel-specific delays for better control
  • Use "[AI] instruction" format for custom AI responses
  • Use submit_chat for X/Twitter URLs instead of regular channels
  • Test with one server first before adding multiple servers
  • Use longer delays for image generation to save API costs

โŒ DON'T:

  • Don't delete server entries - use enabled: false instead
  • Don't forget to add delays to channels (bot will use defaults but it's better to be explicit)
  • Don't use very short delays (< 60s) to avoid rate limits
  • 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

  1. Enable Developer Mode in Discord (Settings โ†’ Advanced โ†’ Developer Mode)
  2. Right-click on any channel
  3. Click "Copy Channel ID"
  4. Paste the ID into servers.json

Visual Guide


๐Ÿ› Troubleshooting

Problem Solution
Bot skips server Check enabled: true is set on server
Bot skips specific channel Check channel doesn't have enabled: false
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
Messages sent too frequently Add or increase delay values in channel configs
Images not generating Check Freepik API key in configs.json (or bot will use free Pollinations.ai)
Submit channels not working Check you're running in correct mode (submit-only or normal)
JSON syntax error Use a JSON validator like jsonlint.com

โ–ถ๏ธ Usage

๐Ÿ“Œ Run the bot

Basic usage:

node index_meomundep.js

With CLI flags:

# Force submit-only mode (only submit_chat channels)
node index_meomundep.js --submit
node index_meomundep.js -s

# Force normal mode (full flow: join, chat, leave)
node index_meomundep.js --chat
node index_meomundep.js -c

# Show help
node index_meomundep.js --help
node index_meomundep.js -h

๐ŸŽฎ Operating Modes

The bot supports two operation modes:

1๏ธโƒฃ Normal Mode (Full Flow)

  • Joins servers (if join_server: true)
  • Processes ALL channel types: submit_chat, raw_chat, command_chat, image_chat
  • Leaves servers (if leave_server: true)
  • Uses AI for message generation

Activate with:

  • CLI: node index_meomundep.js --chat
  • Config: "auto_chat": true (default)
  • Runtime: Select option 2 when prompted (if ask_before_auto_chat: true)

2๏ธโƒฃ Submit-Only Mode

  • Skips server join/leave
  • ONLY processes submit_chat channels
  • Ignores raw_chat, command_chat, image_chat
  • Perfect for dedicated X/Twitter submission tasks

Activate with:

  • CLI: node index_meomundep.js --submit
  • Config: "auto_chat": false
  • Runtime: Select option 1 when prompted (if ask_before_auto_chat: true)

๐Ÿ”„ Mode Priority (highest to lowest):

  1. CLI flags (--submit or --chat)
  2. User prompt (if ask_before_auto_chat: true)
  3. Config setting (auto_chat value)

๐Ÿ“Š Interactive Management

The bot includes a built-in management system accessible via:

node index_meomundep.js
# Then select "Server Manager" from main menu

Management Features:

๐Ÿ–ฅ๏ธ Main Menu:

  1. Server Management (enable/disable servers)
  2. Delay Management (add/show delays)
  3. Submit Management (X post links)
  4. Error Channels Management
  5. Exit

๐Ÿ“ก Server Management:

  • Enable/disable all servers at once
  • Enable/disable specific servers
  • Enable ONLY one server (disable all others)
  • Show server status overview

โฑ๏ธ Delay Management:

  • Add default delays to channels missing them
  • Add custom delays
  • Show delay statistics
  • List unique delay values in use

๐Ÿ”— Submit Management:

  • List all submit channels
  • Add new submit channel
  • Edit submit URLs
  • Remove submit channels
  • Show submit statistics

๐Ÿšซ Error Channel Management:

  • View all error channels by token
  • Delete specific error channels
  • Delete entire token entries
  • Clean up failed channel records

โฌ†๏ธ Update the bot

git pull
npm install

๐Ÿ” How It Works

  1. Reads configuration from configs.json
  2. Checks for CLI flags (--submit, --chat, --help)
  3. Prompts user (if ask_before_auto_chat: true and no CLI flag)
  4. Determines mode (submit-only or normal)
  5. Logs in using provided tokens from tokens.txt
  6. Applies proxy per account (if available in proxies.txt)
  7. Processes each server from servers.json:
    • โœ… Checks if server is enabled: true
    • โœ… Checks if channel is not enabled: false
    • โœ… Checks cooldown timer before sending
    • In normal mode:
      • โž• Joins server (using invite_id) if join_server: true
      • ๐Ÿ’ฌ Processes all channel types
      • โž– Leaves server (using guild_id) if leave_server: true
    • In submit-only mode:
      • ๐Ÿ”— Only processes submit_chat channels
      • โญ๏ธ Skips join/leave and other channel types
  8. Logs every event with timestamps and colored output
  9. Saves timestamps to prevent duplicate posts during cooldown
  10. Waits for delays between actions
  11. Repeats automatically after time_to_restart_all_accounts seconds

๐Ÿ“ Logs and Timestamps

  • Each log entry includes a timestamp
  • Timestamp format follows chat_language setting
  • Color-coded logs for easy reading:
    • ๐ŸŸข Green - Success
    • ๐Ÿ”ด Red - Error
    • ๐ŸŸก Yellow - Warning
    • ๐Ÿ”ต Blue - Info
    • ๐ŸŸฃ Purple - Processing
    • ๐Ÿ”ถ Orange - AI/Provider actions

๐ŸŽ™๏ธ Voice Channel Support

The bot can join and maintain presence in voice channels:

"voice_chat": {
  "enabled": true,
  "server_id": "1234567890123456789",
  "channel_id": "9876543210987654321",
  "user_id": "1111222233334444555"
}

Features:

  • Automatic connection to voice channels
  • Heartbeat mechanism to maintain connection
  • Automatic reconnection on disconnect (up to 5 attempts with exponential backoff)
  • WebRTC protocol support
  • Clean disconnect handling

Requirements:

  • Must have permission to join the voice channel
  • Token must have access to the specified server
  • User ID must match the token's user ID

โš ๏ธ 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.json accordingly
  • ๐Ÿ”’ Keep your tokens and API keys private and secure
  • ๐Ÿšซ Don't share your tokens.txt file with anyone
  • ๐Ÿ’พ Bot automatically saves errors to error-channels.json to avoid retrying failed channels
  • ๐Ÿ”„ Use submit-only mode for dedicated URL submission tasks
  • ๐ŸŽฏ Set appropriate cooldowns per channel to avoid spam detection
  • ๐Ÿค– AI providers are tried in sequence until one succeeds
  • ๐Ÿ“ธ Image generation automatically falls back to free service if Freepik fails
  • โšก CLI flags override all other settings for that run

๐Ÿ“ž Contact & Support


โš ๏ธ 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

Releases

Packages

Used by

Contributors

Languages