This guide takes you from a clean checkout to a running bot in a few minutes.
- Node.js 18 or newer (verify with
node -v) - npm (ships with Node)
- A bot token from @BotFather
Important
You need a bot token before the bot will start. Create one by messaging @BotFather, running /newbot, choosing a name and username, and copying the token.
npm installCopy the example environment file and fill in your values:
cp .env.example .envAt minimum, set the following two variables:
BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
OWNERS=123456789OWNERS is a comma-separated list of Telegram user IDs who bypass every permission check. To find your own user ID, message a bot like @userinfobot, or run HyperGriot's /id command in a chat.
Tip
Leave WEBHOOK_DOMAIN unset to run in long-polling mode, which needs no public URL and is ideal for local testing.
See Configuration for the full variable reference.
npm run build
npm startFor development with hot reload, use:
npm run devWhen the bot starts, it logs a line such as HyperGriot started as @YourBot.
- Add the bot to your group.
- Open the group, edit its settings, go to Administrators, and add the bot.
- Grant it the required rights (see Permissions).
Warning
Moderation commands will not work until the bot is granted the Ban Users right in the group. The bot will reply with a clear error explaining which right is missing.
In the group, run:
/ping
/id
/help
Then try a moderation command by replying to a test message:
/ban test reason
Caution
Only test moderation commands in a group where you are willing to remove the target account, or use a dedicated test group with a second account you control.
Next: Configuration.