/connect code there.
Before you start
Create the bot
1
Create the bot in BotFather
Open @BotFather and send
/newbot. Enter a display name, then a username that ends in bot, such as acme_postqueen_bot. A username is 5 to 32 characters of Latin letters, numbers and underscores.BotFather answers with the bot’s token. Keep it private: anyone with it controls the bot. BotFather also has a Mini App with the same options, if you prefer buttons to commands.2
Turn off group privacy
Send
/setprivacy to BotFather, pick the bot and choose Disable.In a group, a bot with privacy mode on only receives commands that name it, such as /start@acme_postqueen_bot, and the /connect code PostQueen asks for does not name the bot. Administrators receive every message either way, and channels are not affected. If the bot is already in a group, remove it and add it again, because Telegram applies the change only when the bot joins.Set the variables
Add the token and the bot’s username, without the@:
/connect code and to post.
Recreate the app container so it reads the new values. A plain docker restart or
docker compose restart keeps the old container and its old environment.
In the folder that holds docker-compose.yaml, recreate only the postqueen service:
docker compose down for a settings change: on
a host that runs other Compose services in the same project, it stops them too. On Kubernetes, see
Kubernetes with Helm.
Connect a chat
1
Open Add Channel
Open Channels, choose Add Channel, then Telegram. The window names your bot: “Please add @acme_postqueen_bot to your telegram group / channel and click here:”.
2
Add the bot to the chat
In Telegram, add the bot to the channel or group. A channel takes a bot only as an administrator, and it needs the right to post messages. In a group, make it an administrator if privacy mode is still on.
3
Send the /connect code
Back in PostQueen, choose Connect Telegram. The window shows a code such as
/connect a1B2. Choose Copy and send it in the chat exactly as shown.4
Check that it connected
The window checks every 2 seconds and connects the chat once the bot has read the code. If the bot is an administrator allowed to delete messages, it deletes your code and posts “Connection Successful. Message will be deleted in 10 seconds.” Otherwise it says “Connection Successful. I don’t have admin privileges to delete these messages, please go ahead and remove them yourself.” The chat appears in the Channels list with its picture and name.
Troubleshooting
Telegram is not set up on this installation. Add TELEGRAM_TOKEN and TELEGRAM_BOT_NAME to the server environment and restart PostQueen.
Telegram is not set up on this installation. Add TELEGRAM_TOKEN and TELEGRAM_BOT_NAME to the server environment and restart PostQueen.
This is what an admin sees. Other members see “Telegram is not set up on this installation yet. Ask a workspace admin to turn it on.”
TELEGRAM_BOT_NAME is empty: set both variables and recreate the container. An instance with billing turned on says “Telegram cannot be connected right now. Please contact support.” for the same reason.The window keeps waiting after the code was sent
The window keeps waiting after the code was sent
The bot did not receive the code. In a group, privacy mode is still on and the bot is not an administrator: disable it with
/setprivacy, then remove the bot and add it again. In a channel, the bot is not an administrator. Send the code exactly as shown, without adding @ and the bot’s name. If none of that helps, check that no other deployment uses the same token and that the bot has no webhook.409 Conflict: terminated by other getUpdates request
409 Conflict: terminated by other getUpdates request
Another process reads the same bot’s updates. Give each PostQueen deployment its own bot.
Posts to a channel fail
Posts to a channel fail
The bot is not an administrator of the channel, or it lost the right to post messages. Make it an administrator with that right.