diff --git a/lib/types/Message.js b/lib/types/Message.js index ff55df4..ab3299a 100644 --- a/lib/types/Message.js +++ b/lib/types/Message.js @@ -35,6 +35,32 @@ export default class Message extends Base { 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 * @param {number} id message_id of the message to reply to