According to researches by the adsmember team
टेलीग्राम बॉट को Google स्प्रैडशीट (Google Apps Script) से कनेक्ट करें। बेहतर ट्यूटोरियल: // नीचे पूर्ण स्क्रिप्ट: // अपने टेलीग्राम बॉट को Google स्प्रेडशीट (Google Apps स्क्रिप्ट) से कैसे कनेक्ट करें // // // ग्लोबल वेरिएबल टोकन, webAppUrl और ssId में भरें // var टोकन = “”; // अपना खुद का टोकन भरें टेलीग्राम यूआरएल = “ + टोकन; वर webAppUrl = “”; // अपना GOOGLE WEB APP पता भरें var ssId = “”; // अपने स्प्रेडशीट फ़ंक्शन की आईडी भरें getMe() { var url = telegramUrl + “/ getMe”; वर प्रतिक्रिया = UrlFetchApp.fetch (यूआरएल); Logger.log (response.getContentText ()); } फ़ंक्शन सेटवेबहुक() { var url = telegramUrl + “/setWebhook?url=” + webAppUrl; वर प्रतिक्रिया = UrlFetchApp.fetch (यूआरएल); Logger.log (response.getContentText ()); } फ़ंक्शन सेंडटेक्स्ट (आईडी, टेक्स्ट) { var url = telegramUrl + “/sendMessage?chat_id=” + id + “&text=” + text; वर प्रतिक्रिया = UrlFetchApp.fetch (यूआरएल); Logger.log (response.getContentText ()); } फ़ंक्शन doGet(e) {वापसी HtmlService.createHtmlOutput (“हाय वहाँ”); } function doPost(e) {// यह वह जगह है जहां टेलीग्राम काम करता है var data = JSON.parse(e.postData.contents); वर पाठ = data.message.text; वर आईडी = data.message.chat.id; वर नाम = data.message.chat.first_name + “” + data.message.chat.last_name; var उत्तर = “नमस्ते” + नाम + “, आपकी टिप्पणी के लिए धन्यवाद” + पाठ; भेजें टेक्स्ट (आईडी, उत्तर); स्प्रैडशीटऐप.ओपनबायआईड(एसएसआईडी)।गेटशीट्स ()[0].appendRow([new Date(),id,name,text,answer]); if(/^@/.test(text)) { वर शीटनाम = text.slice(1).split(“”)[0]; वर शीट = स्प्रेडशीटऐप.ओपनबीआईडी ​​(एसएसआईडी)। getSheetByName (शीटनाम)? स्प्रैडशीटएप.ओपनबायआईड(एसएसआईडी)।गेटशीटबायनाम(शीटनाम): स्प्रेडशीटऐप.ओपनबीआईडी(एसएसआईडी)।इन्सर्टशीट(शीटनाम); वर टिप्पणी = text.split(” “).slice(1).join(” “); शीट.एपेंडरो ([new Date(),id,name,comment,answer]); } }

source

Rate us
0 0 votes
Article Rating
Subscribe
Notify of
guest
46 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Wim den Herder
Wim den Herder
1 month ago

I've added code to send keyboard menu to the user, you can find it here: https://stackoverflow.com/questions/48431352/telegram-bot-keyboard-with-google-apps-script/72147367#72147367

pradipta kertia
pradipta kertia
1 month ago

Super nice! But, may I ask what's params 'e' for?

Mario Barretta
Mario Barretta
1 month ago

Thank Yuo
How to do the opposite?
From Google sheet to telegram?

MX Cripto
MX Cripto
1 month ago

Great tutorial. For some reason mine cannot connect to my google spreadsheet. I have the exact same code, but it doesn't connect. When I deploy as an app on that step, it doesn't even ask for the permissions. Do you know what could be the issue? I already tried with a new spreadsheet and same thing.

Jonny Hoareau
Jonny Hoareau
1 month ago

Wow, GENIUS…YOU KNOW YOUR STUFF. I can't get over how fast you done that.. Can you make bot to read a telegram message and send to CSV file?

Francesco Carlea
Francesco Carlea
1 month ago

Is it possibile to do the opposite? Call the BOT to see the output of the spreadsheet in telegram

Exammap
Exammap
1 month ago

Sir, I want to send messages in my bot or telegram channel from spreadsheet. Suppose I have saved a lot of message on spreadsheet and I want to post 3-4 message everyday in my telegram channel or bot. Can you make a video on this. No such video is present on youtube. Please help me

Sai Charan Goud
Sai Charan Goud
1 month ago

I couldn't get where you added trigger it is automatically triggering all the time

Giai Đẹp
Giai Đẹp
1 month ago

Hi i got this error: input 1 line it is saved to GGSheet but if enter multiple lines it wont save to GGsheet. How to fix this error? thank you

Scott Jameson
Scott Jameson
1 month ago

I have no idea why step on 7:05 does not work for me. Im not getting message asking permission to send email. and I do not get the email…

shobana maharaj
shobana maharaj
1 month ago

Thank you! Thank you! Thank you!

Talib Abbas
Talib Abbas
1 month ago

Thanks for the video this is awesome. however How can get Msg sender(customer) location ? plz reply

Роман Марков
Роман Марков
1 month ago

Переводчик нужен 😂

Islam Shady
Islam Shady
1 month ago

How can I send a bytton from Apps script?

Chandan Kumar
Chandan Kumar
1 month ago

thnku dear

Marco Vanille
Marco Vanille
1 month ago

it's not working

Yevhenii Dubinin
Yevhenii Dubinin
1 month ago

how to auth in google account directly from telegram? is it possible?

kris riley
kris riley
1 month ago

Thank you so much for the tutorial, very helpful!
How can you enter text in Telegram and have it populate different cells in a row?

Tom Eng
Tom Eng
1 month ago

This. is. awesome!!!! thank you so much!

sharifbasha a
sharifbasha a
1 month ago

Hi wim den Herder

i'm stuck at dopost. i didnt get any code to my mail id.

TypeError: Cannot read property 'postData' of undefined
doPost
@

i got this error

can you help me?

MYOB I have no straight answer from the other
MYOB I have no straight answer from the other
1 month ago

No

Sheer Frost
Sheer Frost
1 month ago

Hi newbie question, will the bot still work if you add it to a group?

Cool Guy Indeed
Cool Guy Indeed
1 month ago

really interesting stuff.. thank you wim

SDN Nagrog
SDN Nagrog
1 month ago

webapi must active ? if i want to use this telegram api?

Nhat Le
Nhat Le
1 month ago

Hello, how to run with getMe? My desktop showed that "No function to run"
Can you help me?

chaitanya solanke
chaitanya solanke
1 month ago

Hii bro you can made this bot for my group

Samahah Razak
Samahah Razak
1 month ago

I have tried the way you show, but the data from the telegram is not sent to email. I need to run manually using script apps but still, the content send to the email null

J M
J M
1 month ago

Hello sir,
I am your Subscriber
I want to send several different messages, with an interval of 1 hour, every hour it sends a random message! Would you help me?

Technical Satya
Technical Satya
1 month ago

How To Add Command In Telegram Bot With Google Sheets

Jack Ryland
Jack Ryland
1 month ago

Do you custom configure for a fee?

ChocoPokey
ChocoPokey
1 month ago

Hi, Thank you for this great tutorial!

Where I am trying to following video 13.27 to 14.05min this point.
function sendText(id,text) {

var url = telegramUrl + "/sendMessage?chat_id=" + id + "&text=" + text;

var response = UrlFetchApp.fetch(url);

Logger.log(response.getContentText());

}
function doPost(e){

//this is where telegram works

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 = "Message Received!" + name +",This is fun (^V^)"+ text;

sendText(id,answer);

GmailApp.sendEmail(Session.getEffectiveUser().getEmail(),"Message sent to bot",answer);

}
Tried to run there is no response hence, I ran the sendText Code function.
Encountered an error as below:
: Message details

Exception: Request failed for https://api.telegram.org returned code 400. Truncated server response: {"ok":false,"error_code":400,"description":"Bad Request: chat not found"} (use muteHttpExceptions option to examine full response) (line 20, file "Code")
Hope you can advise! Thank you!

Natasha Rosli
Natasha Rosli
1 month ago

Is it possible to have google sheet that contain contact numbers and automatically adding them in telegram group?

abdulloh tursunov
abdulloh tursunov
1 month ago

I got this , TypeError: Cannot read property 'postData' of undefined

Crot 889
Crot 889
1 month ago

I would like to ask you .. I would need a python script for the Telegram bot to download the pdf files, thanks

V4 Video
V4 Video
1 month ago

Is this legal?

sm
sm
1 month ago

why i m not getting a message on my gmail as get?

Mostafa Karami
Mostafa Karami
1 month ago

Hi thank you
I have this error, "TypeError: Cannot read property 'postData' of undefined "
I test, logger.log(e) and it was null

but when i send hi in telegram bot, answer sent "hi mostafa undefine,thank…..comment undefined"

What should i do?

Karthika Rajmohan
Karthika Rajmohan
1 month ago

Hii.

Agung Ramadhana
Agung Ramadhana
1 month ago

nice tutor, but can u give a tutorial to send message to telegram bot when insert a new data on google sheet ?? thanks before

ayDTWO
ayDTWO
1 month ago

Looking for a telegram programmer to help build a bot that'll edit telegram message then forward to another group for proprietary reason. I am willing to pay for the service. Regards.

Achmad Ibrahim
Achmad Ibrahim
1 month ago

thank you ,, great tutorial

Kah Bee C
Kah Bee C
1 month ago

super nice, thank you!

NPS Unlocker
NPS Unlocker
1 month ago

hello brother

The Village Trader
The Village Trader
1 month ago

can it connect to any website?

geni eshetu
geni eshetu
1 month ago

I love it

Evan Daniyel
Evan Daniyel
1 month ago

How can I connect google form to telegram?

46
0
Would love your thoughts, please comment.x
()
x