windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
259 stars 116 forks source link

force_reply to messages #222

Closed moshed closed 2 years ago

moshed commented 2 years ago

is it possible to issue a command to the api to force a reply to a messages as seen here. https://core.telegram.org/bots/api#forcereply

I have tried

msg.payload = {
    content: 'test',
    chatId: msg.payload.chatId,
    type: 'message',
    force_reply: true
}

and

msg.payload = {
    content: 'test',
    chatId: msg.payload.chatId,
    type: 'message',
    options: {
        force_reply: true
    }
}

but those don't seem to work

windkh commented 2 years ago

'message' takes the options described here https://core.telegram.org/bots/api#sendmessage maybe you set reply_markup with a ForceReply object

Maybe try something like that msg.payload = { content: 'test', chatId: msg.payload.chatId, type: 'message', options: { reply_markup : { force_reply : true } } }

moshed commented 2 years ago

works perfectly! thanks!

windkh commented 2 years ago

ok nice...

ozett commented 2 years ago

Thats what i was looking for on the readme.md but glad thats all in here. thanks! 👍