You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm scheduling messages using a cron job. Ideally the cron does not run very often, eg every 30 minutes, and we can then schedule the upcoming 30 minutes worth of messages precisely using Telegram's in-built scheduling functions.
Telegraf.js Version: 4.16.3
Node.js Version: 20.11.0
Minimal Example Code Reproducing the Issue
import{Telegraf}from"telegraf";constbot=newTelegraf(token);bot.telegram.sendMessage(123456,"This is a test",{schedule_date: 1712662000})
Expected Behavior
This snippet will run without error and in chat 123456, at timestamp 1712662000 a message will pop up.
Current Behavior
Even before running, this results in a Typescript error (emphasis by me):
Object literal may only specify known properties, and 'schedule_date' does not exist in type 'Omit<{ chat_id: string | number; message_thread_id?: number | undefined; text: string; parse_mode?: ParseMode | undefined; entities?: MessageEntity[] | undefined; ... 4 more ...; reply_markup?: InlineKeyboardMarkup | ... 3 more ... | undefined; }, "chat_id" | "text">'.ts(2353)
(property) schedule_date: number
The text was updated successfully, but these errors were encountered:
I'd like to use
schedule_date
as defined in the API: https://core.telegram.org/api/scheduled-messages.It appears not to be implemented as is.
Context
I'm scheduling messages using a cron job. Ideally the cron does not run very often, eg every 30 minutes, and we can then schedule the upcoming 30 minutes worth of messages precisely using Telegram's in-built scheduling functions.
Minimal Example Code Reproducing the Issue
Expected Behavior
This snippet will run without error and in chat 123456, at timestamp 1712662000 a message will pop up.
Current Behavior
Even before running, this results in a Typescript error (emphasis by me):
The text was updated successfully, but these errors were encountered: