Skip to content

Instantly share code, notes, and snippets.

@nesffer
Created November 3, 2016 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nesffer/73f98bd1eda6ef36a23d37f975b68fff to your computer and use it in GitHub Desktop.
Save nesffer/73f98bd1eda6ef36a23d37f975b68fff to your computer and use it in GitHub Desktop.
bot.ping.js
bot.onText(/^(ping|핑)[!]?$/i, (msg, match) => {
var messageId = msg.message_id;
var chatId = msg.chat.id;
if (match[1].match(/ping/i)) {
bot.sendMessage(chatId, 'Ping!', {reply_to_message_id: messageId});
} else if (match[1].match(/핑/)) {
bot.sendMessage(chatId, '퐁!', {reply_to_message_id: messageId});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment