Telegram
Basic Telegram Chatbot
Bot setup on Telegram
- Open telegram on your mobile device or web browser and start a chat with @BotFather
- Type
/
and select the/newbot
command - Follow the setup instructions
- 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
- Navigate to Stubber Manage
- Select Notifications from the side menu, then Telegram, then Telegram Profiles
- Click on
Add new bot
button - Input your
bot token
and clickCreate 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
- Create a brand new template and switch to the create context
- Click on Open Library at the top right of the page
- Search for
Telegram
, selectTelegram: _update_from_telegram | Context: Create
action and clickAdd action
- 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
- Go to your template overview, under the
Create
tab, click on yourLive
stub - On the top right of the page, click on your stubref to copy it to your clipboard
- Navigate to your bot profile, ensure stubref is clicked, and copy this stubref into the stubref textbox