Naltox / telegram-node-bot

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

Made CallbackGame model serializable #128

Open kvokov opened 7 years ago

kvokov commented 7 years ago

Also please add export of CallbackGame in Models.js file, it's missing now.

Naltox commented 7 years ago

Hey, i dont think there is a reason to make it serializable because its just a placeholder

kvokov commented 7 years ago

Just because I wanna do the things like

let keyboard = new InlineKeyboardMarkup([[
    new InlineKeyboardButton('Play Game', null, null, null, null, new CallbackGame())
]]);
scope.api.sendGame(scope.chatId, config.gameShortName, {
    reply_markup: JSON.stringify(keyboard.toJSON())
})
kvokov commented 7 years ago

I'm pretty sure that all models should have such methods, so will be cool to extend some BaseModel or add mixins