How to connect Telegram to an AI agent
A Telegram channel is needed so the AI agent can reply to customers through your Telegram bot.
To connect, first create a bot in Telegram or take the token of an existing bot, then add it to the AI agent settings in Mobitsa.
What you need beforehand
- The AI agent has already been created.
- The AI agent is enabled.
- You have a Telegram bot or are ready to create one.
- You have the bot token.
Without a token, you cannot connect a Telegram bot to the AI agent.
Which fields need to be filled in Mobitsa
In the Setup: Telegram form, the following fields are usually filled in:
- Channel name — any clear name for you.
- Bot token — the token you get in Telegram from BotFather.
To connect, it is enough to fill in Channel name and Bot token.
Connecting a Telegram bot
- Open @BotFather in Telegram.
- Tap Start.
- Open the BotFather app using the Open button in the bottom-left corner.
- If you already have a bot, select it from the list.
- If you do not have a bot yet, create a new one via Create a New Bot.
- Copy the bot's API Token.
- Paste the token into the Bot token field.
- Click Next to connect the bot and set up the webhook.
How to get the token of an existing bot
- Open @BotFather in Telegram.
- Tap Start.
- Open the BotFather app using the Open button in the bottom-left corner.
- Select the required bot from the list.
- Copy the API Token.
This is the token you need to paste into Mobitsa.
How to fill in Telegram settings in Mobitsa
- Open the required AI agent in Mobitsa.
- Go to the Channels section.
- Add a new channel.
- Select Telegram.
- Enter the Channel name.
- Paste the Bot token.
- Click Next.
Additional settings
To connect a Telegram bot, it is enough to specify the required fields in the channel settings and click Next.
If the token is entered correctly, Mobitsa will set up the webhook automatically.
How to finish the connection
- After filling out the form, click Next.
- Mobitsa will set up the webhook for the Telegram bot.
The webhook is needed so that messages from Telegram start coming into the AI agent.
If the webhook is not set, the bot will not be able to work as an AI agent channel, even if the token is entered correctly.
How to check that everything works
After connecting, check:
- the channel is saved;
- the token is entered without errors;
- the AI agent is enabled;
- the webhook is successfully set.
Then do a test:
- Open your bot in Telegram.
- Send it a test message.
- Return to Mobitsa.
- Check whether a new dialog appears.
If the dialog appears and the AI agent replied, the connection was set up correctly.
What to do if the bot does not respond
First, check the simplest things:
- whether the token was pasted correctly;
- whether the channel is saved;
- whether you clicked Next to set up the webhook;
- whether the AI agent itself is enabled;
- whether you are writing to the exact bot whose token is connected in Mobitsa.
If the bot still does not respond, reopen the channel settings and check the token again.
What is important not to confuse
- Bot token is the main field for connection.
- Channel name is only needed for convenience in the account.
Also remember: creating a bot in Telegram is only the first step, pasting the token into Mobitsa is the second, and clicking Next and setting up the webhook is a required step for a working connection.