Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Counterbot (self-bot)

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)

Important

For allowed automation, use a bot account (OAuth2 bot token) and the official Discord API / discord.js bot flow—not a user token.

Setup

  1. Install Node.js 20.18+ (required by the selfbot library).
  2. Copy .env.example to .env and set your token(s) and CHANNEL_ID.
    • You may run with both DISCORD_TOKEN_ACCOUNT1 and DISCORD_TOKEN_ACCOUNT2 set (default alternating behavior).
    • Or run with a single account by enabling SELF_COUNT_MODE=True and setting SELF_COUNT_USER to DISCORD_TOKEN_ACCOUNT1 or DISCORD_TOKEN_ACCOUNT2, or set COUNTING_ACCOUNT_ONLY=1|2 to force single-account posting. See .env.example for examples.
  3. npm install
  4. npm 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.

Environment

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.

About

Use only if you know what it does

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages