Open fcanela opened 8 years ago
I have the same problem: https://github.com/depoio/node-telegram-bot/issues/78
Sorry, @vbauer, didn't saw your issue.
I hope the fix included in my original post help you with your issue.
I have added :
Bot.prototype.editMessageText = function (options, callback) { var self = this , deferred = Q.defer();
this._get({ method: 'editMessageText', params: { chat_id: options.chat_id, text: options.text, message_id: options.message_id, parse_mode: options.parse_mode, disable_web_page_preview: options.disable_web_page_preview, reply_to_message_id: options.reply_to_message_id, reply_markup: JSON.stringify(options.reply_markup) } }, function (err, res) { if (err) { return deferred.reject(err); }
if (res.ok) {
deferred.resolve(res.result);
} else {
deferred.reject(res);
}
});
return deferred.promise.nodeify(callback); };
and edit message works very well
add : if(!msg.callback_query)
before : if (msg.message.text && msg.message.text.charAt(0) === '/') {
and your error will be fixed
Any news about this problem? Is it possible to fix this issue in library in the nearest future?
@vbauer I am sorry. Currently I am very busy. I would accept any pull request to fix this issue.
Hi guys,
Are you testing based on NPM or from git master?
There was a fix pushed #73 that split out and gracefully handles normal and edited messages.
Based on the code examples I am seeing, they don't seem to match master
hi,I have edited something ,and added new futures, and it supports inline_keyborads and answerCallbackQuery method and editMessageText and ... I wish it could help you.
@theshaun I've been testing library with #73 during last week and everything looks fine, except a new one problem that I've caught few minutes ago: #81
When the server sends a message like (personal information redacted and user id modified):
The following error is raised:
This behaviour can be reproduced this way:
A dirty and quick fix that solved my issue was referencing msg.message to msg.edited_message. Starting from line 216:
There should be probably a better option, but I have no time to validate it right now. I hope this help.
Thanks for the library.