fix: default param value to true to avoid breaking people's existing code; small return value fix
This commit is contained in:
parent
896ef4e84c
commit
68eb5e5483
@ -28,7 +28,7 @@ export default class Base extends EventEmitter {
|
|||||||
* @param {boolean} expectAnswer whether a sent message expects an answer from a contact(s)
|
* @param {boolean} expectAnswer whether a sent message expects an answer from a contact(s)
|
||||||
* @return {Promise} returns a promise, resolved with message:answer
|
* @return {Promise} returns a promise, resolved with message:answer
|
||||||
*/
|
*/
|
||||||
send(bot, expectAnswer = false) {
|
send(bot, expectAnswer = true) {
|
||||||
if (this._keyboard) {
|
if (this._keyboard) {
|
||||||
const replyMarkup = JSON.stringify(this._keyboard.getProperties());
|
const replyMarkup = JSON.stringify(this._keyboard.getProperties());
|
||||||
this.properties.reply_markup = replyMarkup;
|
this.properties.reply_markup = replyMarkup;
|
||||||
@ -43,7 +43,8 @@ export default class Base extends EventEmitter {
|
|||||||
.then(messageId => {
|
.then(messageId => {
|
||||||
if (!expectAnswer) {
|
if (!expectAnswer) {
|
||||||
// no need to add more event callbacks for the messages that don't need expect an answer
|
// no need to add more event callbacks for the messages that don't need expect an answer
|
||||||
return resolve();
|
resolve();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const chat = this.properties.chat_id;
|
const chat = this.properties.chat_id;
|
||||||
@ -73,8 +74,6 @@ export default class Base extends EventEmitter {
|
|||||||
bot.removeListener('update', listener);
|
bot.removeListener('update', listener);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return void 0;
|
|
||||||
})
|
})
|
||||||
.catch(reject)
|
.catch(reject)
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user