1. Telegram
  2. Basic Telegram Chatbot

Telegram

Basic Telegram Chatbot

Bot setup on Telegram

  1. Open telegram on your mobile device or web browser and start a chat with @BotFather
  2. Type / and select the /newbot command
  3. Follow the setup instructions
  4. Once the basic setup is completed you will be provided with your bot token The message will look similar to the image below

Add bot profile on Stubber Manage

  1. Navigate to Stubber Manage
  2. Select Notifications from the side menu, then Telegram, then Telegram Profiles
  3. Click on Add new bot button
  4. Input your bot token and click Create Profile button

Once completed you should see your bot profile (see below)

Create context setup

What is the purpose of this step?


Within the create context of your template, you are defining what happens when new users interact with your if there is no active stubsession.

What we are telling Stubber what to do when someone creates a new stub.

Remember from previous tutorials, that a stub is an instance of your template setup. A refresher on templates and stubs can be found here.

Setup instructions


  1. Create a brand new template and switch to the create context
  2. Click on Open Library at the top right of the page
  3. Search for Telegram, select Telegram: _update_from_telegram | Context: Create action and click Add action
  4. Once completed, your create Context should look like the image below

Stubref routing

What is the purpose of this step?


To tell Stubber where to send messages from users who do not have an active stubsession.

Sets up the routing for messages received by your bot to initiate conversations with your template and create a stub

Setup instructions


  1. Go to your template overview, under the Create tab, click on your Live stub
  2. On the top right of the page, click on your stubref to copy it to your clipboard
  3. Navigate to your bot profile, ensure stubref is clicked, and copy this stubref into the stubref textbox

Previous <- Telegram