Create a Telegram bot

更新时间:
复制 MD 格式

Create a Telegram bot, obtain its API Token, and configure group and channel admin permissions for integration with Chat App Message Service.

Use cases

Chat App Message Service reaches global users through Telegram. You create a bot, obtain its API Token as a credential, and configure admin permissions in groups and channels for broadcasting messages and managing communities.

Overview

The process involves these steps:

  1. Create a new bot with BotFather.

  2. Set the bot's display name and username.

  3. Obtain and save the API Token.

  4. Complete the bot's profile (optional).

  5. Configure admin permissions for groups and channels.

BotFather is Telegram's official bot management tool. All creation and configuration is done by chatting with BotFather.

Step 1: Open BotFather and create a bot

Open BotFather in your Telegram client (mobile, desktop, or web):

  • Search: In the Telegram search bar, enter BotFather and select the account with the official verification badge.

  • Link: Go directly to https://t.me/BotFather.

Click Start, then send /newbot. BotFather guides you through setting the bot's display name and username.

Note

Ensure your network can access Telegram. The mobile or desktop client provides a more stable experience.

Step 2: Set the bot's display name

BotFather first asks for a display name. This name is shown to end users and can be in any language. Examples:

  • Support Assistant

  • My Shop Assistant

  • Order Service Bot

Step 3: Set the bot's username

Next, BotFather asks for a username. The username must meet these requirements:

  • It can only contain English letters, numbers, and underscores.

  • It must end with bot.

For example: my_demo_bot or MyShopHelperBot.

The following usernames are invalid and cannot be used:

Invalid username

Reason

My bot

Contains non-English characters.

test123

Does not end with bot.

shop-helper

Contains a hyphen and does not end with bot.

bot

Too short or already taken.

If the username is taken, try adding numbers or underscores: my_shop_bot or service_01_bot.

Step 4: Obtain and save the API Token

On success, BotFather returns an API Token like: 123456789:AAExampleTokenxxxxxxxxxxxxxxxxxxx

The API Token is the credential for calling the Telegram Bot API and connecting your bot to Chat App Message Service. Record the following:

Item

Example

Bot display name

Customer Service Bot

Bot username

my_demo_bot

API Token

123456789:AAExxxxxxxxxxxxxxxxx

Important

The API Token is your bot's password. Anyone with this token can control your bot. Do not share it in group chats, post screenshots of it, or commit it to a public code repository. If you suspect your token has been compromised, revoke it immediately in BotFather and update the token in the Chat App Message Service console.

Step 5: Complete the bot profile (optional)

Enhance the bot's profile in BotFather with these optional settings:

Command

Function

/setdescription

Set the bot's description.

/setabouttext

Set a short introduction shown when a user opens the bot.

/setuserpic

Upload a profile picture for the bot.

Step 6: Configure bot permissions

To use your bot in groups or channels, enable the required permissions in BotFather.

Enable group access

Required for adding the bot to groups.

Path: /mybots > Select your bot > Bot Settings > Allow Groups > Turn groups on

Turn off group privacy

By default, a bot only receives messages that @-mention it or reply to it. Turning off Group Privacy lets the bot receive all group messages.

Path: /mybots > Select your bot > Bot Settings > Group Privacy > Turn off

Configure group admin rights

Path: /mybots > Select your bot > Bot Settings > Group Admin Rights > Select the required permissions

Configure Group Admin Rights based on your needs:

Note

Recommendations are based on official Telegram documentation and may differ from current features. Select permissions based on your actual requirements.

Permission

Description

Recommendation

Change group name, photo, etc.

Change the group's name, photo, and description.

Recommended

Delete messages

Delete any message sent by a group member.

Required

Restrict, ban or unban members

Ban, unban, or restrict members.

Required

Invite new users

Generate invitation links or add users directly to the group.

Recommended

Pin messages

Pin messages to the top of the group chat.

Optional

Add new administrators

Appoint other members as administrators.

Optional

Manage voice chats

Start, stop, or manage voice or video chats in the group.

Optional

Promote anonymous admins

Allow administrators to post anonymously on behalf of the group.

Optional

Manage Topics

Manage topics in a supergroup where topics are enabled.

Optional

Post stories

Post stories to Telegram Stories on behalf of the group. Requires Telegram Premium.

Not Recommended

Edit stories

Edit stories posted by the group. Requires Telegram Premium.

Not Recommended

Delete stories

Delete stories posted by the group. Requires Telegram Premium.

Not Recommended

Manage chat

Change advanced group settings, such as slow mode and default member permissions.

Required

Configure channel admin rights

Path: /mybots > Select your bot > Bot Settings > Channel Admin Rights > Select the required permissions

Configure Channel Admin Rights based on your needs:

Note

Recommendations are based on official Telegram documentation and may differ from current features. Select permissions based on your actual requirements.

Permission

Description

Recommendation

Change the chat name, photo, etc.

Change the channel's name, photo, and description.

Recommended

Post in the channel

Send messages directly as the channel.

Required

Edit messages of other users, pin messages

Edit messages posted by other administrators or pin messages.

Recommended

Delete messages

Delete any message that has been posted in the channel.

Recommended

Delete participants

Remove or mute subscribers in the channel.

Recommended

Add new administrators

Appoint other members as channel administrators.

Optional

Invite via link

Create, manage, and revoke the channel's invitation links.

Recommended

Manage video chat / live stream

Start, stop, or manage voice or video live streams in the channel.

Not Recommended

Manage direct messages

Receive and reply to direct messages sent to the channel. Requires Telegram Premium.

Not Recommended

Post stories

Post stories to Telegram Stories on behalf of the channel. Requires Telegram Premium.

Not Recommended

Edit stories

Edit stories posted by the channel. Requires Telegram Premium.

Not Recommended

Delete stories

Delete stories posted by the channel. Requires Telegram Premium.

Not Recommended

Manage channel

Change advanced channel settings and view the channel's audit log.

Required

Verify the bot

After configuration, verify that the bot works:

  1. Search for your bot's username (for example, my_demo_bot) and confirm it appears in results.

  2. Open the bot's profile and click Start to confirm it responds.

  3. Go to https://t.me/<your_bot_username> and confirm the link opens correctly.

  4. Add the bot to a test group or channel to confirm its permissions work.

Next steps

Create a Telegram channel in the Chat App Message Service console and bind the bot's API Token to start sending messages.

FAQ

Cannot find BotFather

Confirm the following:

  • You are searching for the exact, case-sensitive term BotFather.

  • You are selecting the account with the official verification badge.

  • Your network connection allows access to Telegram.

You can also go directly to https://t.me/BotFather.

Username is unavailable

The username is already taken. Try these adjustments:

  • Use different keywords in the name.

  • Add a numeric suffix.

  • Use underscores as separators.

The adjusted username must still end with bot. For example: my_shop_bot, myshophelper1_bot, or service_01_bot.

Lost API token

Send /mybots to BotFather and select your bot to view or regenerate the API Token.