UNPKG

telebot

Version:

Easy way to write Telegram bots.

18 lines (14 loc) 420 B
'use strict'; const TeleBot = require('../'); const bot = new TeleBot('-PASTEYOURTELEGRAMBOTAPITOKENHERE-'); // On every type of message (& command) bot.on(['*', '/*'], (msg, self) => { let id = msg.from.id; let reply = msg.message_id; let type = self.type; let parse = 'html'; return bot.sendMessage( id, `This is a <b>${ type }</b> message.`, { reply, parse } ); }); bot.connect();