Creating a Bot

Creating a Bot in Telegram

In Telegram, send a message /newbot to @BotFather and follow the instructions to create your bot. Once the bot is successfully created, a token will be displayed—copy it to your clipboard, as you will need it for further setup. You do not need to change any other bot settings.

Adding a New Bot in the Admin Panel

  1. Activate the "T-bots" and "API" modules in the "Modules" section.

  1. Go to the T-API-bots -> Add section and create a new bot by filling out all the options listed below:

  • Title — the name of the bot for display in the "T-API bots" section for your convenience in identifying it.

  • Status — the status of the bot: • Published — the bot will be active for use • Unpublished — the bot will be inactive for use

  • Logs — log recording for the bot's operations (found in T-API-bots -> Logs) • No — logs will not be recorded • Yes — logs will be recorded

  • API Server — the address of your website without specifying the http(s) protocol. For example: obmen.com

Instructions on how to create an "API login" and "API key" can be found in this guide.

  • API Login — the login from the API section

  • API Key — the key from the API section

  • Version — the version of the bot (currently only v1 is available) • v1

  • Type — the language the bot will use to communicate with users. If you want to create a bot in multiple languages, you will need to create several bots and select the appropriate language for each. • RUEN

  • API Partner ID — if an ID is specified, all requests will be considered partner requests, and the specified user will receive a percentage from all exchanges. You can find the user ID in the "Users" section.

  • Test Server — a button to check the bot's connection to the exchange API. A successful test result will indicate a correct connection of the bot to the API.

Array ( [error] => 0 [error_text] => [data] => Array ( [ip] => 000.000.000.0000 [user_id] => 0 [locale] => ru_RU [partner_id] => 827 ) )
  1. Click the "Save" button.

  2. Then fill in the "Token" field with the token you copied earlier from the created Telegram bot via @BotFather.

  1. Click the "Save" button again.

  2. After filling in all the connection details, register the webhook by following the link on the settings page.

If the bot is not functioning correctly or stops responding to commands, re-register the webhook—first delete the existing one and then register a new one.

  1. Enter @your_bot_username in Telegram and click the "Start" button to begin the exchange.

  1. Optionally, perform additional bot settings.

  2. If you are using CloudFlare or a similar service for your website, add the IP addresses of Telegram to the Whitelist in your service. Instructions for adding to the CloudFlare Whitelist can be found here.

Last updated