Closed aisqwe closed 8 years ago
this is meaningless without piece of code. Please share your code and console output.
I am trying to use "reply_markup" as below, but failed. I don't quite understand what should I pass to reply_markup
api.sendMessage({
chat_id: chat_id,
reply_markup: {
ForceReply: {
force_reply: true
},
ReplyKeyboardMarkup: {
keyboard: [ ["1","2"],["3","4"] ]
}
},
text: message.text ? 'reply to you: '+message.text : 'Your message doesn\'t contain text :('
}, function(err, data)
{
if (err != null) { console.log(err); }
console.log(data);
});
TypeError: Object #<Object> has no method 'on'
at Function.DelayedStream.create (/home/algouser/algo_fix/nodefix/node_modules/telegram-bot-api/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
then I try this as well, but still no use
reply_markup: '{ "ForceReply":{ force_reply: "True" } }',
you will need to serialize values for reply_markup with JSON.stringify()
reply_markup: JSON.stringify({keyboard: [['1','2'],['3','4']]})
great, it worked. Thanks.
Closing as no response from originator is provided.
when trying to send a keyboard in sendMessage this error comes up:
source.on('error', function() {});
TypeError: undefined is not a function at Function.DelayedStream.create