windkh / node-red-contrib-telegrambot

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

"msg.payload.type is empty" #205

Closed sciaio closed 3 years ago

sciaio commented 3 years ago

Hello, following the instructions I was learning how to implement the custom keyboard feature but when I tried the first example with the function node filled with:

var opts = {
  reply_markup: JSON.stringify({
    keyboard: [
      ['A1'],
      ['A2']],
      'resize_keyboard' : true,
      'one_time_keyboard' : true
  })
};

msg.error = false;
// Dialogaufbau
msg.payload.content = 'Selection?';
msg.payload.options = opts;

msg.payload.chatId = 123445;
msg.payload.messageId = 99;
msg.payload.sentMessageId = 99;
msg.payload.type = "message";

return [ msg ];

In the debug menu, Node-Red gives me "msg.payload.type is empty":

image

Why this happens? The msg.payload.type was there and defined. What am I missing?

Thanks

windkh commented 3 years ago

You must use the correct javascript syntax

image