Fix bot not working properly in groups
Change example a little bit
This commit is contained in:
@ -99,7 +99,6 @@ var Bot = (function (_EventEmitter) {
|
||||
_this.update.offset += 1;
|
||||
}
|
||||
|
||||
_this.emit('update', response.result);
|
||||
result.forEach(function (res) {
|
||||
var text = res.message.text;
|
||||
if (text.startsWith('/')) {
|
||||
@ -112,8 +111,10 @@ var Bot = (function (_EventEmitter) {
|
||||
var pattern = _ref.pattern;
|
||||
return pattern.test(text);
|
||||
});
|
||||
ev.listener(res);
|
||||
ev.listener(res.message);
|
||||
});
|
||||
|
||||
_this.emit('update', result);
|
||||
});
|
||||
}).bind(this);
|
||||
|
||||
|
@ -111,6 +111,8 @@ var Message = (function (_Base) {
|
||||
value: function send(bot) {
|
||||
var _this = this;
|
||||
|
||||
console.log('sending message');
|
||||
|
||||
var messageId = undefined;
|
||||
var reply_markup = JSON.stringify(this._keyboard.getProperties());
|
||||
this.properties.reply_markup = reply_markup;
|
||||
|
@ -80,8 +80,7 @@ var Question = (function (_Message) {
|
||||
var answers = this.answers;
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
_get(Object.getPrototypeOf(Question.prototype), 'send', _this).call(_this, bot).then(function (update) {
|
||||
var message = update.message;
|
||||
_get(Object.getPrototypeOf(Question.prototype), 'send', _this).call(_this, bot).then(function (message) {
|
||||
var answer = undefined;
|
||||
|
||||
answers.forEach(function find(a) {
|
||||
|
Reference in New Issue
Block a user