@ChanMBot 6.1

In this update we will add /md and /html to inline!

bot.on('inlineQuery', msg => {
  let query = msg.query;
  let answers = bot.answerList(msg.id);

  if (query.startsWith('/html ')) {
    query = query.replace('/html ', '');
    answers.addArticle({
      id: 'html',
      title: 'HTML',
      description: `${query}`,
      message_text: `${query}`,
      parse_mode: 'html',
      disable_web_page_preview: true
    });
  } else if (query.startsWith('/md')) {
    answers.addArticle({
      id: 'markdown',
      title: 'Markdown',
      description: `${query}`,
      message_text: `${query}`,
      parse_mode: 'markdown',
      disable_web_page_preview: true
    });
  }

  return bot.answerQuery(answers);
});

Leave a Reply

Your email address will not be published. Required fields are marked *