Connect Telegram
Connect Lingchu Bot to Telegram groups and supergroups through nonebot-adapter-telegram.
Prerequisites
Section titled “Prerequisites”- A Telegram bot token from @BotFather.
- Lingchu Bot installed and
.envconfigured withLINGCHU_SUPERUSERS. - Network access to the Telegram Bot API (directly or through a proxy).
Configure the adapter
Section titled “Configure the adapter”Set the driver, select the Telegram adapter, and register the bot token in .env:
DRIVER=~fastapi+~httpxLINGCHUAdapter=~telegramtelegram_bots=[{"token":"1234567890:..."}]Long polling is used by default. Configure telegram_proxy when direct access to Telegram is unavailable. Webhook deployments require HTTPS and the upstream adapter webhook settings.
Prepare the bot in BotFather
Section titled “Prepare the bot in BotFather”- Create the bot through BotFather and copy the token into
telegram_bots. - Disable privacy mode through BotFather so Lingchu receives ordinary group messages.
- Add the bot to each group where it should operate.
- Promote the bot to group administrator with the rights required for moderation commands (kick, mute, delete messages, manage admins).
Verify the connection
Section titled “Verify the connection”- Start the bot:
uvx --from nb-cli nb.exe run. - Wait for
Application startup complete.in the logs. - Send
菜单(ormenuin English locale) to the bot from a Telegram group where it is an administrator.
If the menu appears, the connection is live. If not, see Troubleshooting.
Available commands
Section titled “Available commands”Telegram currently supports:
- Kick, block, and unblock members.
- Mute and unmute members.
- Mute and unmute the whole group through default chat permissions.
- Promote and demote administrators.
- Rename and leave a group.
- Delete a message by replying to it with the recall command.
- Lingchu silence, speak, boot, and shutdown state commands.
- Permission-filtered menus.
QQ-only cards, special titles, group avatars, announcements, remote management, and protocol restart commands are hidden on Telegram.
Group identity
Section titled “Group identity”Telegram group persistence uses chat.id. Forum topic and sender information does not change the group authorization scope.
Related pages
Section titled “Related pages”- Select and configure an adapter — adapter selection details
- QQ command reference — full QQ command list for comparison
- Troubleshooting — common connection issues