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
axfree commented 2016-03-16 12:14:48 +00:00 (Migrated from github.com)

This patch adds html and markdown formatting for messages.

var htmlText = '<i>italic</i> and <b>bold</b>';
var markdownText = '_italic_ and *bold*';

// new way
bot.send(new Message().html(htmlText).to(chat_id));
bot.send(new Message().markdown(markdownText).to(chat_id));

bot.send(new Message().text(htmlText).html().to(chat_id));
bot.send(new Message().text(markdownText).markdown().to(chat_id));

// old way
bot.send(new Message({parse_mode:'HTML'}).text(htmlText).to(chat_id));
bot.send(new Message({parse_mode:'Markdown'}).text(markdownText).to(chat_id));

This patch adds html and markdown formatting for messages. ``` javascript var htmlText = '<i>italic</i> and <b>bold</b>'; var markdownText = '_italic_ and *bold*'; // new way bot.send(new Message().html(htmlText).to(chat_id)); bot.send(new Message().markdown(markdownText).to(chat_id)); bot.send(new Message().text(htmlText).html().to(chat_id)); bot.send(new Message().text(markdownText).markdown().to(chat_id)); // old way bot.send(new Message({parse_mode:'HTML'}).text(htmlText).to(chat_id)); bot.send(new Message({parse_mode:'Markdown'}).text(markdownText).to(chat_id)); ```
mdibaiee commented 2016-03-17 11:14:21 +00:00 (Migrated from github.com)

@axfree: Hey! Thank you for the pull-request! published to npm telegram-api@0.6.1

@axfree: Hey! Thank you for the pull-request! published to npm `telegram-api@0.6.1`
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/node-telegram-api#16
No description provided.