Creating a Telegram Bot¶
Talk to @BotFather¶
Telegram has a bot for creating bots. Find and message @BotFather:
You: /newbot
BotFather: Alright, a new bot. How are we going to call it?
Please choose a name for your bot.
You: DexterBot
BotFather: Done! Congratulations on your new bot.
Use this token to access the HTTP API:
462xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Save the token — you'll need it for local.json.
Find Your User ID¶
There are several ways to find your Telegram user ID:
- Start Dexter without admins configured, then send
/identifyto the bot — it will reply with your ID - Register in the channel with
/poracleand check thehumanstable in the database - Interact with the bot and check
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
Create a Registration Group¶
- Create a new Telegram group
- Invite your Dexter bot to the group
- Send
/identifyin the group to get the group's ID (a negative number)
Configure Dexter¶
Add to your config/local.json:
{
"telegram": {
"enabled": true,
"token": "YOUR_BOT_TOKEN",
"admins": ["YOUR_USER_ID"],
"channels": ["GROUP_ID"]
}
}
Test It¶
- Start Dexter
- In the registration group, send
/poracleto register - Open a DM with the bot and click Start (or visit
https://t.me/YourBotName?start) - You should receive a welcome message
Group-Based Tracking¶
Admins can register any group that the bot is a member of using the /channel add command. After that, tracking commands in the group will send results to that group.