Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 带有谷歌表单的电报机器人API_Javascript_Telegram Bot_Google Sheets Api - Fatal编程技术网

Javascript 带有谷歌表单的电报机器人API

Javascript 带有谷歌表单的电报机器人API,javascript,telegram-bot,google-sheets-api,Javascript,Telegram Bot,Google Sheets Api,你知道有没有可能把谷歌的答案发送到电报上 例如,如果有人提出请求,我会直接从GoogleSheets表中回答他,并在表单元格中写入消息 我的机器人在JavaScript上写的,也许这个函数可以做到: return HtmlService.createHtmlOutput("Hi there"); } function doPost(e) { // this is where telegram works var data = JSON.parse(e.postData.

你知道有没有可能把谷歌的答案发送到电报上

例如,如果有人提出请求,我会直接从GoogleSheets表中回答他,并在表单元格中写入消息

我的机器人在JavaScript上写的,也许这个函数可以做到:

        return HtmlService.createHtmlOutput("Hi there");
}

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 = "Hi, " + name + " wait an answer  " + text;
  sendText(id,answer);
  SpreadsheetApp.openById(ssId).getSheets()[0].appendRow([new Date(),id,name,text,answer]);

直接从谷歌表格中回答他是什么意思?我的意思是我会在谷歌表格中写一条信息,然后通过电报发送给用户。从谷歌工作表发送。它不会自动运行,只有当我在谷歌工作表中写一条消息,用户才能收到我的电报。我想你们应该在你们的问题中添加更详细的解释,它应该如何工作我只想在谷歌工作表的单元格中写。这个消息将被发送到电报机器人