Allow module consumers to deal with Promise rejections themselves #38

Merged
laurynas-karvelis merged 2 commits from master into master 2018-02-05 18:15:02 +00:00
Showing only changes of commit 790f988148 - Show all commits

View File

@ -34,11 +34,11 @@ export default class Base extends EventEmitter {
}
let messageId;
return new Promise(resolve => {
return new Promise((resolve, reject) => {
bot.api[this.method](this.properties).then(response => {
messageId = response.result.message_id;
this.emit('message:sent', response);
});
}).catch(reject);
if (this._keyboard.one_time_keyboard) {
this._keyboard.replyMarkup = '';