Skip to content
GBTI

How to get a Telegram Bot Token - AndShare Tutorial

Creating a Telegram bot and getting a bot token involves a few steps:

Step 1: Talk to BotFather

  1. Open your Telegram app, then search for the “BotFather” bot. The username is @BotFather.
  2. Start a chat with BotFather by clicking the “Start” button at the bottom of the screen.

Step 2: Create a New Bot

  1. Type /newbot to create a new bot.
  2. BotFather will ask you for a name for your bot. Type the name and send it.
  3. Next, you’ll be asked to choose a username for your bot. This username must end in bot, like examplebot or example_bot.
  4. If all goes well, BotFather will congratulate you and provide you with a token.

Step 3: Store the Token

  • After creating the bot, you’ll get a message that contains the token for the bot. Make sure to save this token securely as you’ll need it to interact with the Telegram API.

Note

  • You’ll need to make your bot an admin in your Telegram channel or group to post messages, delete messages, etc.

The token will look something like this:

110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw Replace <YOUR_BOT_TOKEN> in the code with this token.

After these steps, you can use this token to perform operations as your bot, like sending messages, in the context of the Telegram API.

For more advanced features or for the official documentation, you can visit the Telegram Bot API documentation.

A creator network, powered by Git

Join the GBTI Network

The GBTI Network is a creator community. Browse, follow, and save across the network for free, no card required. Join a paid tier to take part and share in the revenue.

Network Member ($50/year): post comments across the network; full Discord access; read members-only content and comment bodies; and see the member-only Shares stream. Earn 10% for life on the paid revenue of members you invite.
Content Creator ($150/year): everything in Network Member, plus publish articles, products, and prompts; post to the member Shares stream; your creator profile and unified portfolio; and reshare and syndicate your work. Content Creators share in the revenue program.
Become a member You are reading GBTI Network's work. Joining from this page credits GBTI Network.

Written by

GBTI Network

Creative. Curative. Community. Cooperative. Published 2nd Sep 2023

View profile

Get the weekly digest

One email a week: new member articles, projects and prompts, plus the developer news worth reading. Unsubscribe in one click, any time.

We send a confirmation email first. You are not subscribed until you click the link in it. Read the privacy policy.

0 Comments

No comments yet. Be the first. Members comment from the GBTI local client, where comments are submitted as pull requests and auto-published for paid members.

Become a member

Comments are for members. Become a member to join the conversation, or if you already are.

You are signed in as a member. .

Contribution history

Related posts

Join the GBTI co-op

Saving, collecting, and following are member perks. Sign in with a free GitHub account to keep what you find, and become a member to comment, join the Discord, and unlock members-only content.