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
Before the 0.65 release on March 9th 2024, I was able to have a small beginner telegram bot that checks if the message a user replied to with '/isimage' command is a image (where the bot would type out 'that is an image') or if it is text (where the bot would say nothing), the following code worked before fine, but as of the 0.65 update, reply_to_message object property of message is undefined, and I can no longer find a reply_to_message object property to check if the user typing '/isimage' command is a reply to a previous message made by another user, and if that message is a photograph or not (via message.reply_to_message.photo property)
Here is the code I made below, that worked pre 0.65 update:
const TelegramBot = require('node-telegram-bot-api');
const token = '[MY TOKEN]';
const bot = new TelegramBot(token, { polling: true });
bot.on('message', (msg) => { const chatId = msg.chat.id;
if (msg.text && msg.text.toLowerCase() === '/isimage') {
if (msg.reply_to_message && msg.reply_to_message.photo) {
bot.sendMessage(chatId, 'You have an image');
}
}
});
What would be the new way to write this out as per the 0.65 update, and if there is nothing to change, why is reply_to_message now undefined, when pre march 9th, it was defined and worked flawlessly.
The text was updated successfully, but these errors were encountered:
Hello,
Before the 0.65 release on March 9th 2024, I was able to have a small beginner telegram bot that checks if the message a user replied to with '/isimage' command is a image (where the bot would type out 'that is an image') or if it is text (where the bot would say nothing), the following code worked before fine, but as of the 0.65 update, reply_to_message object property of message is undefined, and I can no longer find a reply_to_message object property to check if the user typing '/isimage' command is a reply to a previous message made by another user, and if that message is a photograph or not (via message.reply_to_message.photo property)
Here is the code I made below, that worked pre 0.65 update:
What would be the new way to write this out as per the 0.65 update, and if there is nothing to change, why is reply_to_message now undefined, when pre march 9th, it was defined and worked flawlessly.
The text was updated successfully, but these errors were encountered: