Telegram setup
These are abbreviated instructions from https://core.telegram.org/bots/tutorial.
Tip
Use https://web.telegram.org for these steps instead of your phone, for easier copying and pasting.
Creating a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbot - Follow the prompts to name your bot
- Copy the bot token - you'll need it for
TELOXIDE_TOKENin thesecrets.envfile
Configuring your bot for a telegram group
TrufotBot will send announcements on telegram groups; these can be configured per-patient (but the same group can be reused for multiple patients). For instance, you can have a group "Medication for Alice", which will have everyone who gives Alice medication.
- Invite your bot to a telegram group
- Send
/helpto the group - The bot will reply with the group ID (a negative number like
-1001234567890) - Use this group ID when creating a patient (under "Telegram Group ID").
Reading group messages (for natural input)
By default, Telegram bots in groups only receive /commands, @-mentions, and
replies to the bot's own messages. To use
natural input (sending messages like
Nurofen 7.5 without a slash command), the bot must be allowed to read normal
messages in the group.
Do either of the following:
- Recommended: Make the bot an administrator of the Telegram group. This only affects that specific group.
- Disable privacy mode for the bot as a whole: in @BotFather, send
/setprivacy, choose your bot, and select Disable. If the bot is already in the group, remove and re-invite it so Telegram applies the new setting.