A Discord selfbot built using discord.py-self, designed to listen to external commands via a command_queue, process them internally, and respond through a result_queue. It maintains persistent data using SQLite databases to track servers and users.
- ✅ Queue-based command system via
command_queueandresult_queue - 🔄 Periodic background task for listening to commands
- 📂 SQLite-backed persistent storage for servers and users
- 🔍 Mutual server scanning for user IDs
- ⚡ Quick existence check of users
- 🛠 Server DB renewal and cleanup
- ➕➖ Add/remove users or servers manually
The main entry point is the run_selfbot(command_queue, result_queue) function:
- Starts a Discord selfbot using
discord.py-self. - Initializes SQLite databases on startup (
users.dbandservers.db). - Runs an asynchronous loop (
command_listener) every second to process items from a queue. - Processes commands like
say,ping,mutuals,quickscan, and others based on command type. - Returns results back to the caller via the
result_queue.
| Column | Type | Description |
|---|---|---|
userid |
INTEGER | Discord user ID (Primary Key) |
serverids |
TEXT | Comma-separated IDs of mutual servers |
scantime |
TEXT | ISO timestamp of the last scan/update |
| Column | Type | Description |
|---|---|---|
date_added |
TEXT | ISO timestamp when added |
server_name |
TEXT | Name of the server |
server_id |
INTEGER | Discord server ID (Primary Key) |
reason |
TEXT | Optional reason for whitelisting |
Each command is a tuple of:
- Description: Echoes a message
- Data:
str - Returns: Message back in the result queue
- Description: Health check or echo test
- Data:
str - Returns: Same data
- Description: Finds mutual servers with given user IDs
- Data:
List[str]of user IDs - Returns: String listing mutual servers
- Description: Checks if user IDs exist in the database
- Data:
List[str] - Returns: Status string (✅ or ❌)
- Description: Adds or updates current servers in
servers.db - Returns:
(True, "Servers database renewed successfully.")
- Description: Removes servers by ID and updates affected users
- Data:
List[str]of server IDs - Returns: Confirmation string of removed servers
- Description: Adds user IDs to the database
- Data:
List[str]of user IDs - Returns: Confirmation of added users
- Description: Removes user IDs from the database
- Data:
List[str]of user IDs - Returns: Confirmation or warning if none found
Place your Discord token in a file called token_app.txt:
YOUR_APPLICATION_TOKEN_HERE
Place your Discord user token in a file called token_self.txt:
YOUR_USER_ACCOUNT_TOKEN_HERE
- Python 3.8+
discord.py-self- SQLite3 (default in Python)
Selfbots are against Discord's Terms of Service and using them can result in your account being banned. This project is for educational purposes only.
MIT License. See LICENSE for more information.