Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
723 stars 143 forks source link

toJSON methods return Objects and not strings #164

Open vsviridov opened 7 years ago

vsviridov commented 7 years ago

I'm trying to use the ForceReply object in my reply_markup of the sendMessage options. I have to manually do something like

$.sendMessage("Message text...", {
  reply_markup: JSON.stringify(new ForceReply(true).toJSON())
});

which is pretty silly. either toJSON should serialize correctly (documentation says that return type for this method is string), or sendMessage should correctly serialize provided options.