This project runs two Discord user accounts in one Node.js process so they alternate posting a number sequence in a channel: account 1 sends 1, 3, 5, … and account 2 sends 2, 4, 6, … That enforces:
- No skipped numbers (must be
last + 1) - No going backwards (same rule)
- No double posts from the same account (odd/even split)
- Self-bots break Discord’s Terms of Service. Your accounts can be disabled permanently.
- Never share your user token. Treat it like a password.
- The common Node approach is the
discord.js-selfbot-v13family (originally aiko-chan-ai/discord.js-selfbot-v13; the README there has setup examples). An actively maintained fork is 002-sans/djs-selfbot-v13.
For allowed automation, use a bot account (OAuth2 bot token) and the official Discord API / discord.js bot flow—not a user token.
- Install Node.js 20.18+ (required by the selfbot library).
- Copy
.env.exampleto.envand set your token(s) andCHANNEL_ID.- You may run with both
DISCORD_TOKEN_ACCOUNT1andDISCORD_TOKEN_ACCOUNT2set (default alternating behavior). - Or run with a single account by enabling
SELF_COUNT_MODE=Trueand settingSELF_COUNT_USERtoDISCORD_TOKEN_ACCOUNT1orDISCORD_TOKEN_ACCOUNT2, or setCOUNTING_ACCOUNT_ONLY=1|2to force single-account posting. See.env.examplefor examples.
- You may run with both
npm installnpm start
“Two tabs”: Discord self-bots are not run in browser tabs; this script logs in both accounts from your machine. Keep one terminal/process for this project.
| Variable | Meaning |
|---|---|
DISCORD_TOKEN_ACCOUNT1 |
User token for the account that posts odd numbers |
DISCORD_TOKEN_ACCOUNT2 |
User token for the account that posts even numbers |
CHANNEL_ID |
Target text channel ID (numeric ID or a channel link like https://discord.com/channels/<server>/<channel>) |
Enable Developer Mode in Discord (Settings → App Settings → Advanced) to copy IDs from the context menu.