Closed mammad2c closed 7 years ago
Yes, that's actually weird, maybe it's somehow related to the fact, that you use this lib, which returns promise.
And, it's only the assumption, you should probably call .then()
to get the result
yea,
I changed my code and used .then()
.
tnx
Hi, getChatMember not working? it sends me promise but relay on Telegram Bot api, must return a chatMember object. and promise is still pending. https://core.telegram.org/bots/api#getchatmember
my code : `'use strict'
const Telegram = require('telegram-node-bot'); const TelegramBaseController = Telegram.TelegramBaseController; const TextCommand = Telegram.TextCommand; const tg = new Telegram.Telegram('token');
class PingController extends TelegramBaseController { /* * @param {Scope} $ / pingHandler($) { $.sendMessage('pong'); var testMember = tg.api.getChatMember($.message.chat.id, $.message.from.id); console.log(testMember) // result : promise {pending} }
}
tg.router .when( new TextCommand('ping', 'pingCommand'), new PingController() )`