Merge pull request #16 from axfree/master

Add html and markdown formatting for messages.
This commit is contained in:
Mahdi Dibaiee 2016-03-17 14:42:54 +03:30
commit 370aeccf3d

View File

@ -35,6 +35,32 @@ export default class Message extends Base {
return this; return this;
} }
/**
* Set text of the message in HTML format
* @param {string} text Message's content in HTML format
* @return {object} returns the message object
*/
html(text) {
this.properties.parse_mode = 'HTML';
if (text) {
this.properties.text = text;
}
return this;
}
/**
* Set text of the message in Markdown format
* @param {string} text Message's content in Markdown format
* @return {object} returns the message object
*/
markdown(text) {
this.properties.parse_mode = 'Markdown';
if (text) {
this.properties.text = text;
}
return this;
}
/** /**
* Set reply_to_message_id of the message * Set reply_to_message_id of the message
* @param {number} id message_id of the message to reply to * @param {number} id message_id of the message to reply to