Telegram enables its users to create and maintain various functions. One of the most brilliant ideas is using it as instructional media for learning. This post reveals the step-by-step guide on how to integrate Telegram into teaching and learning. First of all, the following draws how it is processed in the system.
sequenceDiagram
participant Students
participant Bot
participant Script
participant Database
Students->>Bot: Sends command for Agenda, Lesson, or Tryout
Bot->>Script: Triggers request
Script-->>Database: Fetches agenda and lesson
Script-->>Database: Executes tryout
Script-->>Bot: Returns data or confirmation
Bot-->>Students: Responds request
Students->>Script: Submits tryout answers via form
Script-->>Database: Saves tryout answers and updates sheet
Script-->>Bot: Sends notification to user and/or admin
Bot-->>Students: Sends agenda and lesson
Bot-->>Students: Processes score
This project comprises of 2 modals - Bot and database. In this project, we will apply Telegram to handles communication with database. To ease and to make it cost-effective, Spreadsheet is applied as the hosting.
Bot
First of all, create your bot, name it, and complete the process till you get the token. To create Bot on Telegram, navigate to search bar and search for BotFather.
Spreadsheet
Next, draw your database on Spreadsheet. Simpply navigate to Spreadsheet and name Sheets
AppsScript
After writing the script, you need to deploy the script as web app. After that, copy the link into the following url in web browser to webhook the webappurl.
https://api.telegram.org/bot123abc/setWebhook?url=webappurl
To unhook the webapp url, apply the same url with webappurl removed.
When the app works with a channel, the following link is used to check chat ID.
https://api.telegram.org/bot123abc/getUpdates
In addition, the following links are also useful.
https://api.telegram.org/bot123abc/getMe
https://api.telegram.org/bot123abc/sendChatAction