Telegram Bot Tutorial: How to connect your Telegram Bot to a Google Spreadsheet (Apps Script)

Wim den Herder · 239K views · 2017 · 22:02

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the working walkthrough for connecting a Telegram bot to Google Sheets via Apps Script, and many of their questions start from its code.

Recommended by 1 people across 2 different months, 2017 to 2021.

What it is

A 22-minute screencast by Wim den Herder showing how to wire a Telegram bot to a Google Spreadsheet using Google Apps Script. It covers getMe, setWebhook, a web app endpoint with doGet and doPost, and replying to users and logging messages in a sheet, with the full script in the description.

What people said

Recommends abielita · 2017-10 · Stack Overflow · on “how to communicate telegram bot with google sheet”

You may follow the instructions in this video tutorial: How to connect your Telegram Bot to a Google Spreadsheet (Apps Script) Script in Description [this video] . // // FILL IN THE GLOBAL VARIABLES token, webAppUrl and ssId // var token = ""; // FILL IN YOUR OWN TOKEN var telegramUrl = " [LINK] " + token; var webAppUrl = ""; // FILL IN YOUR GOOGLE WEB APP ADDRESS var ssId = ""; // FILL IN THE ID OF YOUR SPREADSHEET function getMe() { var url = telegramUrl + "/getMe"; var response = UrlFetchApp.fetch(url); Logger.log(response.getContentText()); } function setWebhook() { var url = telegramUrl + "/setWebhook?url=" + webAppUrl; var response = UrlFetchApp.fetch(url); Logger.log(response.getContentTex

Recommends abielita · 2018-02 · Stack Overflow · on “How to get access to google spreadsheets from telegram bot on phone?”

You may want to check this video tutorial [this video] on how to connect your Telegram Bot to a Google Spreadsheet but using Apps Script. This library [LINK] also provides a pure Python interface for the Telegram Bot API [LINK] . It's compatible with Python versions 2.7, 3.3+ and PyPy [LINK] . It also works with Google App Engine [LINK] .

Cites Ololeg · 2017-10 · Stack Overflow · on “Using .appendRow with formulas”

So I followed this tutorial and created a Telegram bot, which would send all messages to my spreadsheet: [this video] The point is that I need only one variable--text. So I modified the code a little bit: function doPost(e) { var data = JSON.parse(e.postData.contents); var text = data.message.text; var id = data.message.chat.id; var name = data.message.chat.first_name + " " + data.message.chat.last_name; var answer = "Hi " + name + ", thank you for your comment " + text; sendText(id,answer); SpreadsheetApp.openById(ssId).getSheets()[0].appendRow([text]); I do also have formulas for some ranges (say, B1:B21). The problem is that the script would add my only entry to A22. Any ideas how to make it w

Cites honeyhill · 2018-04 · Stack Overflow · on “Connect telegram bot with google apps script”

I have setup a bot on telegram bot and connected it with google spreadsheets via apps script by following this [this video] tutorial. Here is the code: var token = ""; // FILL IN YOUR OWN TOKEN var telegramUrl = " [LINK] " + token; var webAppUrl = ""; // FILL IN YOUR GOOGLE WEB APP ADDRESS var ssId = ""; // FILL IN THE ID OF YOUR SPREADSHEET function getMe() { var url = telegramUrl + "/getMe"; var response = UrlFetchApp.fetch(url); Logger.log(response.getContentText()); } function setWebhook() { var url = telegramUrl + "/setWebhook?url=" + webAppUrl; var response = UrlFetchApp.fetch(url); Logger.log(response.getContentText()); } function sendText(id,text) { var url = telegramUrl + "/sendMessage?c

Cites Colin · 2021-06 · Stack Overflow · on “Send a scheduled message in my telegram bot linked to a google spreadsheet”

I've built a telegram bot using guidance from this video: [this video] Is there any way to edit the sendText function such that I could allow the bot to send a message at a set time? function sendText(id,text){ var url = telegramUrl + "/sendMessage?chat_id=" + id + "&text=" + text; var response = UrlFetchApp.fetch(url); } Thank you!