Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
¿Cómo configurar los comandos del bot de Telegram a través de Google Apps Script?

Aquí está la definición de mis comandos de Apps Script y la función:

 function setBotCommands() { const BOT_COMMANDS = [ { command: "start", description: "Start" }, { command: "joke", description: "Chucke jokes" } ]; var bot = new Bot(botToken, {}); var result = bot.request('setMyCommands?commands=', BOT_COMMANDS); Logger.log(result); var cmdtmp = bot.request('getMyCommands'); Logger.log(cmdtmp); }

que pasa bien, pero getMyCommands devuelve una matriz vacía:

 6:23:40 AM Notice Execution started 6:23:40 AM Info {ok=true, result=true} 6:23:40 AM Info {result=[], ok=true} 6:23:40 AM Notice Execution completed

La solicitud se define de la siguiente manera:

 Bot.prototype.request = function (method, data) { var options = { 'method' : 'post', 'contentType': 'application/json', 'payload' : JSON.stringify(data) }; var response = UrlFetchApp.fetch('https://api.telegram.org/bot' + this.token + '/' + method, options); if (response.getResponseCode() == 200) { return JSON.parse(response.getContentText()); } return false; }

Cualquier suposición, ¿qué me he perdido aquí? ¡Gracias!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!