Add html and markdown formatting for messages. #16

Merged
axfree merged 1 commits from master into master 2016-03-17 11:12:54 +00:00
Showing only changes of commit 91ede6188e - Show all commits

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