How to Build an AI Telegram Bot to Manage Your Group (Announce, Pin, Moderate)

piotrgrudzien1 pts0 comments

How to Build an AI Telegram Bot to Manage Your Group (Announce, Pin, Moderate) | Quickchat AI - AI Agents<br>English Deutsch Español Français 日本語 Polski Português Svenska

Log in Start for free<br>Start for free

Solutions Use Cases<br>Customer Support Sales & Lead Generation Ecommerce IT & Internal Helpdesk Enterprise<br>Channels & Integrations<br>Website chat WordPress WhatsApp Discord Shopify Intercom Zendesk HubSpot All channels & integrations<br>Platform Releases Contact us

Why Us Pricing Resources About us Case Studies Careers Blog Affiliate Program Legal Documentation Status Contact<br>Log in Start for free

{t.navigation.log_in}

{t.navigation.book_a_demo}

-->

How to Build an AI Telegram Bot to Manage Your Group (Announce, Pin, Moderate)<br>Piotr Grudzień on June 26, 2026 • 32 min read

Introduction

A Quickchat AI Agent on Telegram already answers questions in your group (here is how to set that up if you have not yet). This guide shows you how to build an AI Telegram bot that manages your group : on top of answering questions, it can look up chat info, post and pin announcements, and moderate members by muting or banning them, all in plain language. An admin types “ban the user I just replied to” and the Agent makes the call.

You do this with AI Actions : custom HTTP requests your Agent can make during a conversation. Telegram does not have a one-click integration like Google Sheets or HubSpot, so you add these actions by hand , the same way you would when moderating a Discord server with AI Actions. Each action is one Telegram Bot API method. By the end you will have a working community management toolkit that the whole group can talk to, with the destructive actions locked to admins by a server-side gate (not just a prompt rule), and you will have tested each action yourself .

You need three things:

a Quickchat AI Agent (sign up here and use for free )

a Telegram bot (created in two minutes with @BotFather)

a Telegram group where your bot is an admin

This is a long, exact walkthrough. The canonical reference for AI Actions lives in the docs at docs.quickchat.ai/ai-agent/actions. For the Telegram channel setup itself, see the Telegram integration docs. The full list of methods this post calls is in the Telegram Bot API reference.

What you will build

Six AI Actions , each one a Telegram Bot API method. Two are read-only and safe for anyone; four change the group and are locked to admins (we set that up in Step 7):

ActionBot API methodWho can run itWhen the Agent calls itGet chat infogetChatAnyoneA user asks about the group (title, description, type)Count membersgetChatMemberCountAnyoneA user asks how many members the group hasPost announcementsendMessageAdmins onlyAn admin asks to announce or post somethingPin a messagepinChatMessageAdmins onlyAn admin replies to a message and asks to pin itMute a memberrestrictChatMemberAdmins onlyAn admin replies to a user and asks to mute themBan a memberbanChatMemberAdmins onlyAn admin replies to a user and asks to ban them<br>“Admins only” here is not a polite request to the model. It is a deterministic gate that Quickchat AI checks on its own side before the action runs, using a Telegram-verified flag. We explain it in “Make admin actions admin-only (and mean it)” and wire it up in Step 7.

The screenshots below come from a test bot in a test group. Every conversation and every Bot API call shown here was produced by a real Agent running the real reply pipeline. Use your own bot and group when you follow along.

How Telegram AI Actions work

The whole feature rests on one idea: an AI Action is a described HTTP request, and a Telegram Bot API call is one such request. The model decides when to call it and fills in the judgment values; Quickchat AI injects the identifiers and the bot token and sends the request.

The split that makes these actions reliable: the model never types an id or a token, so it cannot target the wrong chat or person. It only supplies the judgment values the conversation provides.

Three facts make the rest of the post easy to follow.

Every Bot API call has the same shape. Telegram methods are called as https://api.telegram.org/bot/, with the arguments in the URL query or a JSON body. So each action is one URL plus a small body. Looking up the member count is a GET; posting, pinning, muting, and banning are POSTs.

The Agent never sees your bot token. A bot token controls the whole bot, so it must not reach the model. You write it in the action URL as a placeholder, {{telegram_bot_token}}:

https://api.telegram.org/bot{{telegram_bot_token}}/getChat<br>In the action editor the token is a system token , shown as a badge rather than free text:

The token is a system-token badge in the endpoint URL. The model never receives its value.

Quickchat AI fills that placeholder with your real token after the model has decided to call the action and only when the request is built and sent. The token never enters the prompt, the tool the model sees, or the Inbox...

telegram group actions token agent admin

Related Articles