yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.12k stars 1.49k forks source link

How to use schedule_date flag in sendMessage #1209

Open qertis opened 6 days ago

qertis commented 6 days ago

Question

Hello. How can the schedule_date flag from the official documentation https://core.telegram.org/method/messages.sendMessage be used in the bot.sendMessage method?

qertis commented 6 days ago

This example doesn't working:

await bot.sendMessage(activity.target.id, 'result', {
    // todo - after 1 minutes
    schedule_date: Math.floor((new Date(new Date().getTime() + 1 * 60000)).getTime() / 1000),
  })