DOCUMENTATION IS HEREEEEE, YAAAY ✌️ ✌️
+ Small fixes
This commit is contained in:
@ -11,10 +11,6 @@ const DEFAULTS = {
|
||||
}
|
||||
};
|
||||
|
||||
process.on('uncaughtException', function(err) {
|
||||
console.error(err.stack);
|
||||
});
|
||||
|
||||
/**
|
||||
* Bot class used to connect to a new bot
|
||||
* Bots have an api property which gives access to all Telegram API methods,
|
||||
@ -75,8 +71,6 @@ export default class Bot extends EventEmitter {
|
||||
} else {
|
||||
return poll(this);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -46,17 +46,5 @@ export default class Forward extends Base {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets keyboard of the message
|
||||
* The value of reply_markup is set to the sanitized keyboard properties
|
||||
* i.e. reply_markup = JSON.stringify(kb.getProperties())
|
||||
* @param {object} kb A Keyboard instance
|
||||
* @return {object} returns the message object
|
||||
*/
|
||||
keyboard(kb) {
|
||||
this._keyboard = kb;
|
||||
return this;
|
||||
}
|
||||
|
||||
// This class inherits Base's send method
|
||||
}
|
||||
|
@ -45,6 +45,16 @@ export default class Message extends Base {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set disable_web_page_preview of the message
|
||||
* @param {boolean} enable
|
||||
* @return {object} returns the message object
|
||||
*/
|
||||
preview(enable = true) {
|
||||
this.properties.disable_web_page_preview = !enable;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets keyboard of the message
|
||||
* The value of reply_markup is set to the sanitized keyboard properties
|
||||
|
@ -62,7 +62,7 @@ export default class Question extends Message {
|
||||
return message;
|
||||
} else {
|
||||
this.emit('question:invalid', message);
|
||||
throw update;
|
||||
throw message;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user