Integromat - nCoV Telegram Bot






Integromat

What is Integromat?

  • automate processes that currently handled manually

  • connect apps, transfer and transform data

  • work 24 hours a day, seven days a week

  • do not require manual intervention.

Simply set Integromat to do what you want and let it work for you. Save your time!

Main page on integromat.com

Telegram Bot

Chat with @BotFather to create a new bot

  • Step 1: Type /newbot

  • Step 2: Enter name and username for the bot

  • Step 3: After creating bot, you'll receive a Token for bot

  • Step 4: Save the token for later accessing the HTTP API

How to get Chat ID?

  • Use IDBot

  • Add the Bot to a group

  • Use command /getgroupid@myidbot

  • The Bot returns the group ID

Save the Group ID for later setup.

Scenario: nCoV Chat Bot

Requirements

  • Create Telegram Bot to get required information on nCoV

  • Report if the message is error

  • Save message logs: time, chat id, group id, type text...

Logic Flow Diagram

This is how the the Bot should work.

Create a new Scenario

On main page choose Create a new scenario

Choose services to intergrate.

In this case we'll choose:

  • Telegram Bot: trigger and send message

  • HTTP: get information on nCoV

  • Google Sheets: record message logs

Set up the Scenario

  • Step 1, select Telegram Bot, choose Watch Updates module

This will trigger the whole scenario when a message calls for the bot in Telegram.

  • Step 2, link the module with the Bot that created in Telegram.

Using Webhook, link the two with the Bot's Token that given. Select Add, to add the Webhook

Select Add to add connection to the Bot.

Insert the Token, then Continue

  • Step 3, Connect to a second module, Make a Request from HTTP.

This module helps us getting information on nCoV on websites using API.

In this case, we'll use the API on website theVirusTracker.com. The API from the website provide us the GET method.

For example, using URL https://api.thevirustracker.com/free-api?global=stats to get information on the virus all over the word.

  • Step 4, Copy and Paste https://api.thevirustracker.com/free-api? to the URL box.

  • Step 5, On Query String box, select Add parameter.

That's equivalent to the URL above.

  • Step 6, Choose Parse response, select OK.

  • Step 7, Create module Send a Text Message or a Reply.

This will send the message including the information required.

  • Step 8, Select the connection to the Bot.

  • Step 9, Enter Chat ID, this is where the Bot will send the message

  • Step 10, Type what you want the Bot to return.

Remember to run the HTTP module before to see what result of data you're getting.

  • Step 11, Press Run Once. The message will return the values we want Telegram

  • Step 12, From Google Sheets, choose Add a Row module.

Choose connection to your Google account, in which you have your Google Sheets.

  • Step 13, select the Spreadsheet and the values to save in columns. Press OK.

Every message logs will be recorded to the Spreadsheet.

  • Step 14, Click Save.

  • Step 15, Set Scheduling for the Scenario. Choose Immediately for all the time the Bot is triggered.

  • Step 16, Use Router module, this will help in seperate cases to process.

To return a text when a command isn't right, add a path to another Telegram Bot. Add the module between the first Telegram Bot and the HTTP module.

Also select Send a Text Message or a Reply to send a message for the person who triggers the command that is wrong.

  • Step 17, Setup this module like as Step 7.

For example, this will return the message if the type doesn't start with slash(/).

  • Step 18, Setup Filter for the path after the Router

The filters must be created for different paths of each module after the Router

That's the end of the Basic Steps. Have fun discovering more.

This is the basic Scenario.

After developing, this is a more completed version.

Find more of what it can do at

Cồ Rô Nà Vai Rớt

Note: call out the bot in the group (has many bots) before using. e.g. /start@nCoV_hmv_bot