telegram-node-bot icon indicating copy to clipboard operation
telegram-node-bot copied to clipboard

Made CallbackGame model serializable

Open kvokov opened this issue 8 years ago • 3 comments

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

kvokov avatar Oct 05 '16 18:10 kvokov

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

Naltox avatar Oct 06 '16 07:10 Naltox

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 avatar Oct 06 '16 10:10 kvokov

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

kvokov avatar Oct 06 '16 10:10 kvokov