{"id":30250483,"url":"https://github.com/sohamxyzdev/discordselfbotcopypaste","last_synced_at":"2026-04-14T06:33:32.084Z","repository":{"id":306258889,"uuid":"991044147","full_name":"SohamXYZDev/DiscordSelfbotCopyPaste","owner":"SohamXYZDev","description":"Discord selfbot that monitors channels and mirrors messages with automatic watermark removal/replacement. Configurable RGB color detection, image processing with JIMP, and webhook forwarding. Educational purposes only.","archived":false,"fork":false,"pushed_at":"2025-07-13T12:58:37.000Z","size":105,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T10:37:01.745Z","etag":null,"topics":["discord","discord-api","discord-bot","discord-js","discord-py","discord-selfbot","discord-selfbot-v13","discord-selfbot-webhook","discord-token","discordapp","discordbot","discordjs","selfbot","selfbot-discord","selfbot-for-discord","selfbots","watermark","watermark-removal","watermark-remover","watermarking"],"latest_commit_sha":null,"homepage":"https://www.sohamxyz.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SohamXYZDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-27T03:37:42.000Z","updated_at":"2025-07-13T13:48:39.000Z","dependencies_parsed_at":"2025-07-24T17:34:38.010Z","dependency_job_id":null,"html_url":"https://github.com/SohamXYZDev/DiscordSelfbotCopyPaste","commit_stats":null,"previous_names":["sohamxyzcom/discordselfbotcopypaste","sohamxyzdev/discordselfbotcopypaste"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SohamXYZDev/DiscordSelfbotCopyPaste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SohamXYZDev%2FDiscordSelfbotCopyPaste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SohamXYZDev%2FDiscordSelfbotCopyPaste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SohamXYZDev%2FDiscordSelfbotCopyPaste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SohamXYZDev%2FDiscordSelfbotCopyPaste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SohamXYZDev","download_url":"https://codeload.github.com/SohamXYZDev/DiscordSelfbotCopyPaste/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SohamXYZDev%2FDiscordSelfbotCopyPaste/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270552728,"owners_count":24605575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-api","discord-bot","discord-js","discord-py","discord-selfbot","discord-selfbot-v13","discord-selfbot-webhook","discord-token","discordapp","discordbot","discordjs","selfbot","selfbot-discord","selfbot-for-discord","selfbots","watermark","watermark-removal","watermark-remover","watermarking"],"created_at":"2025-08-15T10:00:57.384Z","updated_at":"2026-04-14T06:33:32.079Z","avatar_url":"https://github.com/SohamXYZDev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Selfbot with Dynamic Channel Mirroring\n\nA Discord selfbot that automatically mirrors messages from source channels to dynamically created mirror channels with automatic webhook management.\n\n## ⚠️ IMPORTANT DISCLAIMER\n\n**This project uses a Discord selfbot, which violates Discord's Terms of Service. Use at your own risk. Your account may be banned if detected by Discord.**  \n**This code is provided \"as-is\" for experimentation and learning purposes only.**\n\n## ✨ Features\n\n- **⚙️ Centralized Configuration**: All settings in `config.json` - only tokens in `.env`\n- **🤖 Automatic Channel Creation**: Automatically creates mirror channels in your target server with matching names\n- **🗺️ Manual Channel Mapping**: Option to map source channels to existing target channels (prevents duplicates!)\n- **🔗 Dynamic Webhook Management**: Creates and stores webhooks automatically - no manual setup required!\n- **🔄 Hot Reload Config**: Edit `config.json` to change any setting without restarting the bot!\n- **📁 Category Structure Options**:\n  - Create all mirror channels in a specified category\n  - OR copy the source channel's category structure automatically\n- **♾️ Unlimited Channels**: Monitor as many source channels as you want\n- **🤖 Bot Mode**: Use a separate bot account instead of webhooks for replying and editing\n- **🌐 Full Server Copy**: Mirror ALL channels from an entire server automatically\n- **💾 Persistent Storage**: Webhooks are saved to `webhooks.json` for reuse across restarts\n- **🎯 Slip ID Extraction**: Detects and extracts slip identifiers from Discord messages with components\n- **📊 Comprehensive Logging**: Detailed console output for debugging and monitoring\n- **✏️ Edit Tracking**: Monitors message edits and updates mirrored messages\n\n## 🚀 Quick Start\n\n### 1. Install Dependencies\n\n```bash\nnpm install\n```\n\n### 2. Configure Environment\n\nCopy `.env.example` to `.env` and add your **tokens** (sensitive data only):\n\n```env\n# Your Discord selfbot token (REQUIRED)\nTOKEN=your_discord_token_here\n\n# Bot token (only if using bot mode)\nBOT_TOKEN=your_bot_token_here\n```\n\n### 3. Configure Settings\n\nCopy `config.json.example` to `config.json` and customize (all non-sensitive settings):\n\n```json\n{\n  \"targetGuildId\": \"your_target_guild_id_here\",\n  \n  \"modes\": {\n    \"useBotMode\": false,\n    \"fullServerCopy\": false,\n    \"autoCreateChannels\": true\n  },\n  \n  \"channels\": [\n    \"source_channel_id_1\",\n    \"source_channel_id_2\"\n  ],\n  \n  \"categorySettings\": {\n    \"targetCategoryId\": \"\",\n    \"copyCategoryStructure\": false\n  },\n  \n  \"botSettings\": {\n    \"username\": \"Bot\"\n  }\n}\n```\n\n**How to get IDs:**\n- Enable Developer Mode in Discord (Settings → Advanced → Developer Mode)\n- Right-click server/channel/category → Copy ID\n\n### 4. Configure Channels\n\nEdit the `channels` field in `config.json` (supports hot reloading):\n\n### 4. Configure Channels\n\nEdit the `channels` field in `config.json` (supports hot reloading):\n\n**Option A: Auto-create mode (default)** - Array format:\n```json\n{\n  \"channels\": [\n    \"959825174453178408\",\n    \"1133806078027644978\",\n    \"1030038318668333066\"\n  ]\n}\n```\n\n**Option B: Manual mapping mode** - Object format:\n```json\n{\n  \"channels\": {\n    \"source_channel_id_1\": \"target_channel_id_1\",\n    \"source_channel_id_2\": \"target_channel_id_2\",\n    \"source_channel_id_3\": \"target_channel_id_3\"\n  }\n}\n```\n\nUse manual mapping when:\n- ✅ You already have target channels from a previous setup\n- ✅ Source server deletes/remakes channels (prevents duplicate creation)\n- ✅ You want specific channel pairing control\n\nTo enable manual mapping, also set in `config.json`:\n```json\n{\n  \"modes\": {\n    \"autoCreateChannels\": false\n  }\n}\n```\n\n**Changes take effect immediately** - no restart needed! Just save `config.json` and the bot automatically detects:\n- ✅ Added channels\n- 🗑️ Removed channels\n- ⚙️ Updated settings\n\n**Optional settings:**\n\nAll optional settings are in `config.json`. See `config.json.example` for full list:\n\n```json\n{\n  \"modes\": {\n    \"useBotMode\": false,\n    \"fullServerCopy\": false,\n    \"autoCreateChannels\": true\n  },\n  \"sourceGuildId\": \"\",\n  \"categorySettings\": {\n    \"targetCategoryId\": \"\",\n    \"copyCategoryStructure\": false\n  },\n  \"botSettings\": {\n    \"username\": \"Bot\"\n  }\n}\n```\n\n### 5. Run the Bot\n\n```bash\nnode index.js\n```\n\n### 6. First Run - What to Expect\n\nOn first run, when a message appears in a monitored channel:\n\n1. **Automatic Setup**: Bot creates a mirror channel with the same name\n2. **Webhook Creation**: Creates a webhook automatically\n3. **Storage**: Saves mapping to `webhooks.json`\n4. **Message Forward**: Forwards the message immediately\n\n**Console output:**\n\n```\n📨 Message received in channel-name\n🆕 No webhook found, creating new channel and webhook...\n📍 Target guild: Your Server Name\n🆕 Creating channel: channel-name\n✅ Created channel: channel-name\n🔗 Creating webhook...\n✅ Created webhook\n💾 Saved webhook mappings\n✅ Message successfully mirrored!\n```\n\n**Subsequent messages** in the same channel will use the stored webhook instantly!\n\n## ⚙️ Configuration Options\n\n### Operating Modes\n\n#### Mode 1: Individual Channels + Webhooks (Default)\n```json\n{\n  \"modes\": {\n    \"useBotMode\": false,\n    \"fullServerCopy\": false\n  }\n}\n```\nConfigure channels in `config.json`. Perfect for selective monitoring with hot reload.\n\n#### Mode 2: Individual Channels + Bot Account\n```json\n{\n  \"modes\": {\n    \"useBotMode\": true,\n    \"fullServerCopy\": false\n  }\n}\n```\nAdd `BOT_TOKEN` to `.env`. Allows replying and editing messages.\n\n**Bot Setup:**\n1. Create bot at https://discord.com/developers/applications\n2. Add to target server with permissions: Send Messages, Embed Links, Attach Files, Read Message History\n3. Copy bot token to `.env`\n\n#### Mode 3: Full Server Copy + Webhooks\n```json\n{\n  \"modes\": {\n    \"useBotMode\": false,\n    \"fullServerCopy\": true\n  },\n  \"sourceGuildId\": \"source_server_id_here\"\n}\n```\nCopies ALL text channels from entire source server. No need to list individual channels.\n\n#### Mode 4: Full Server Copy + Bot Account\n```json\n{\n  \"modes\": {\n    \"useBotMode\": true,\n    \"fullServerCopy\": true\n  },\n  \"sourceGuildId\": \"source_server_id_here\"\n}\n```\nBest for large operations. Bot must be in both source and target servers.\n\n### Mode Comparison\n\n| Feature | Webhook Mode | Bot Mode |\n|---------|--------------|----------|\n| Setup Complexity | ✅ Simple | ⚠️ Needs bot account |\n| Can Reply | ❌ No | ✅ Yes |\n| Can Edit | ❌ No | ✅ Yes |\n| Rate Limits | ✅ Lower | ⚠️ Higher |\n| Custom Username | ✅ Yes | ❌ Shows bot name |\n\n| Feature | Individual Channels | Full Server |\n|---------|---------------------|-------------|\n| Setup | `config.json` | Just sourceGuildId |\n| Selective | ✅ Choose specific | ❌ Copies everything |\n| Hot Reload | ✅ Yes (config.json) | ❌ Restart required |\n\n### Configuration Files\n\n**config.json** (all settings, hot reload supported):\n- `targetGuildId` - Target server ID\n- `modes` - useBotMode, fullServerCopy, autoCreateChannels\n- `channels` - Array or object for channel mapping\n- `sourceGuildId` - For full server copy\n- `categorySettings` - targetCategoryId, copyCategoryStructure\n- `botSettings` - username\n\n**.env** (tokens only, sensitive):\n- `TOKEN` - Discord selfbot token\n- `BOT_TOKEN` - Bot account token (if using bot mode)\n\n### Required Settings\n\n| Variable/Field     | File         | Description                                      |\n| ------------------ | ------------ | ------------------------------------------------ |\n| `TOKEN`            | `.env`       | Your Discord selfbot token                       |\n| `targetGuildId`    | `config.json`| Server ID where mirror channels will be created  |\n| `channels`         | `config.json`| Source channel IDs to monitor                    |\n\n### Optional Settings\n\nAll in `config.json`:\n\n| Field                           | Default | Description                                                     |\n| ------------------------------- | ------- | --------------------------------------------------------------- |\n| `modes.useBotMode`              | `false` | Use bot account instead of webhooks for forwarding              |\n| `modes.fullServerCopy`          | `false` | Copy all channels from source server                            |\n| `modes.autoCreateChannels`      | `true`  | Auto-create target channels. Set `false` for manual mappings    |\n| `sourceGuildId`                 | `\"\"`    | Source server ID (required if `fullServerCopy=true`)            |\n| `categorySettings.targetCategoryId` | `\"\"` | Category ID to create all mirror channels under                 |\n| `categorySettings.copyCategoryStructure` | `false` | If `true`, recreates source category structure         |\n| `botSettings.username`          | `\"Bot\"` | Username displayed in webhook messages                          |\n\nAnd in `.env`:\n\n| Variable    | Default | Description                                   |\n| ----------- | ------- | --------------------------------------------- |\n| `BOT_TOKEN` | `null`  | Bot token (required if `useBotMode=true`)     |\n\n## 📋 How It Works\n\n1. **Startup**: Bot loads source channel IDs and existing webhook mappings from `webhooks.json`\n2. **Message Received**: When a message appears in a monitored source channel:\n   - Checks if mirror channel/webhook exists\n   - If not, creates mirror channel (with same name as source)\n   - Creates webhook in mirror channel\n   - Saves mapping to `webhooks.json`\n   - Forwards the message\n3. **Future Messages**: Uses stored webhook for instant forwarding\n\n## 📁 Files Generated\n\n- **`config.json`**: Main configuration file (you create/edit this, supports hot reload)\n  \n  **Array format (auto-create):**\n  ```json\n  {\n    \"targetGuildId\": \"...\",\n    \"channels\": [\n      \"channel_id_1\",\n      \"channel_id_2\"\n    ]\n  }\n  ```\n  \n  **Object format (manual mapping):**\n  ```json\n  {\n    \"targetGuildId\": \"...\",\n    \"modes\": {\n      \"autoCreateChannels\": false\n    },\n    \"channels\": {\n      \"source_channel_id_1\": \"target_channel_id_1\",\n      \"source_channel_id_2\": \"target_channel_id_2\"\n    }\n  }\n  ```\n\n- **`webhooks.json`**: Auto-generated file storing channel/webhook mappings\n  ```json\n  {\n    \"source_channel_id\": {\n      \"webhookUrl\": \"https://discord.com/api/webhooks/...\",\n      \"targetChannelId\": \"mirror_channel_id\",\n      \"targetChannelName\": \"channel-name\",\n      \"sourceChannelName\": \"original-name\",\n      \"createdAt\": \"2025-12-21T...\",\n      \"manualMapping\": false\n    }\n  }\n  ```\n\n## 🎯 Slip ID Extraction\n\nWhen messages with Discord components (buttons) are detected, the bot extracts:\n\n- Message ID and timestamps\n- CDN parameters (`ex`, `is`, `hm`) from image URLs\n- Interaction metadata (command names, user info)\n- Attachment IDs\n\nThis is useful for tracking betting slips or other interactive content.\n\n## 🔧 Advanced Usage\n\n### Category Structure Copying\n\nWhen `COPY_CATEGORY_STRUCTURE=true`:\n\n- Bot detects the source channel's category\n- Creates matching category in target server (if doesn't exist)\n- Places mirror channel in matching category\n- Maintains organized server structure automatically\n\n### Manual Channel Mapping\n\nWhen you want to use existing target channels instead of auto-creating:\n\n1. Set `autoCreateChannels: false` in `config.json` modes\n2. Use object format for channels:\n   ```json\n   {\n     \"modes\": {\n       \"autoCreateChannels\": false\n     },\n     \"channels\": {\n       \"source_channel_id\": \"target_channel_id\"\n     }\n   }\n   ```\n\n**Benefits:**\n- Reuse existing channels from previous setups\n- Prevents duplicates when source channels are deleted/remade\n- Full control over which source maps to which target\n\n**Example:**\n```json\n{\n  \"channels\": {\n    \"959825174453178408\": \"1367853127859966105\",\n    \"1133806078027644978\": \"1367853127859966106\",\n    \"1030038318668333066\": \"1367853127859966107\"\n  }\n}\n```\n\nHot reload works with manual mappings too! Edit `config.json`, save, and changes apply instantly.\n\n### Adding More Channels\n\n**With `config.json` (Recommended):**\n\nSimply edit the file and save:\n\n```json\n{\n  \"channels\": [\n    \"existing_channel_id\",\n    \"new_channel_id_here\",\n    \"another_new_channel_id\"\n  ]\n}\n```\n\nBot detects changes and reloads automatically! Console shows:\n```\n🔄 Detected change in config.json, reloading...\n✅ Added 2 new channel(s): [...]\n📊 Total channels loaded: 5\n```\n\n## 🛡️ Security Notes\n\n- This uses Discord selfbot functionality (against Discord ToS)\n- Token is sensitive - never share your `.env` file\n- Bot requires \"Manage Channels\" and \"Manage Webhooks\" permissions in target server\n- Webhook URLs are stored locally in `webhooks.json`\n\n## 🐛 Debugging\n\nThe bot provides detailed console output:\n\n- ✅ Success messages (green check)\n- ❌ Error messages (red X)\n- 📊 Status information (chart emoji)\n- 🔍 Processing steps (magnifying glass)\n\nCheck the console for real-time monitoring of:\n\n- Channel loading status\n- Webhook creation progress\n- Message forwarding confirmation\n- Error details with codes\n\n## 📝 Example Output\n\n```\n🔍 Loading source channel IDs from .env...\n✅ Loaded source channel 1: 123456789012345678\n✅ Loaded source channel 2: 234567890123456789\n...\n\n📊 Total source channels to monitor: 25\n🎯 Target guild ID: 987654321098765432\n\n📂 Loaded existing webhook mappings: 3\n\n✅ Logged in as YourBot#1234\n📡 Monitoring 25 source channels\n🔄 Ready to mirror messages!\n\n📨 Message received in general (123456789012345678)\n   Author: User#1234\n   Content: Hello world...\n   Embeds: 1, Attachments: 0\n\n🔍 Processing channel: general (123456789012345678)\n✅ Using existing webhook for general\n📤 Forwarding 1 embed(s)...\n✅ Embed(s) forwarded\n\n✅ Message successfully mirrored from general\n```\n\n## 🆘 Troubleshooting\n\n### Common Issues\n\n| Issue                            | Solution                                                                                |\n| -------------------------------- | --------------------------------------------------------------------------------------- |\n| \"TARGET_GUILD_ID not configured\" | Add `targetGuildId` to `config.json`                                                    |\n| \"Could not fetch target guild\"   | 1. Verify your token's account is in the target server\u003cbr\u003e2. Check server ID is correct |\n| \"Error creating channel\"         | Bot needs \"Manage Channels\" permission in target server                                 |\n| \"Error creating webhook\"         | Bot needs \"Manage Webhooks\" permission in target server                                 |\n| \"No source channels configured\"  | Add at least one channel to `config.json`                                               |\n| No messages forwarded            | 1. Verify source channel IDs are correct\u003cbr\u003e2. Check bot can see those channels         |\n| Webhook creation fails           | Make sure target server isn't at webhook limit (15 per channel)                         |\n| \"No manual mapping found\"        | Using manual mode? Add mapping in `config.json` channels object format                  |\n| Duplicate channels created       | Set `autoCreateChannels: false` in config.json and use manual mappings                  |\n| Config not loading               | Check `config.json` syntax is valid JSON (use a JSON validator)                         |\n\n### Permissions Required\n\nYour Discord account needs these permissions in the **target server**:\n\n- ✅ Manage Channels\n- ✅ Manage Webhooks\n- ✅ Send Messages\n- ✅ Embed Links\n- ✅ Attach Files\n\n### Reset/Fresh Start\n\nIf you need to start over:\n\n1. Delete `webhooks.json`\n2. Optionally delete created mirror channels in target server\n3. Run bot again - it will recreate everything\n\n### Getting Help\n\nCheck the console output for detailed error messages. Every operation is logged with:\n\n- ✅ Success indicators\n- ❌ Error details with descriptions\n- 🔍 Processing steps\n\n## 📦 What Gets Created\n\n### In Your Target Server\n\n- Mirror channels (one per source channel)\n- Webhooks (one per mirror channel)\n- Categories (if `COPY_CATEGORY_STRUCTURE=true`)\n\n### In Your Project Folder\n\n- `config.json` - main configuration (you create/edit this)\n- `webhooks.json` - stores all mappings (auto-generated)\n\n**Note:** Both files are in `.gitignore` for security.\n\n## Socials\n\nCreated \u0026 maintained by Soham Mitra (SohamXYZ)\n\n- 🌐 Website: [https://sohamxyz.com](https://sohamxyz.com)\n- 📧 Email: soham@sohamxyz.com\n- 💬 Discord: sohamxyz\n- 🧠 bots/selfbots/automation/dev inquiries welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohamxyzdev%2Fdiscordselfbotcopypaste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsohamxyzdev%2Fdiscordselfbotcopypaste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohamxyzdev%2Fdiscordselfbotcopypaste/lists"}