S
S
salkynbekov2021-03-09 20:52:56
API
salkynbekov, 2021-03-09 20:52:56

How to implement the setMyCommands(telegram BOT API) method in Google Apps Script?

var token = "123456......";
var url = "https://api.telegram.org/bot" + token;

function setMyCommands(){
  var botCommand = {
    "commands": [
      {
        "command": "alert",
        "description": "text"
      },
      {
        "command": "start",
        "description": "text"
      }
    ]
  }

  var data = url + "/setMyCommands"
  
  var response = UrlFetchApp.fetch(data,botCommand);
  Logger.log(response.getContentText())

}


please tell me how to set telegram commands to the bot. In general, there is info and tutorials about how to send a message or make buttons. Alas, I could not find a solution for commands.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question