Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created April 10, 2016 09:34
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 codeaholicguy/3105f170430e360ba762a0051e5fdda9 to your computer and use it in GitHub Desktop.
Save codeaholicguy/3105f170430e360ba762a0051e5fdda9 to your computer and use it in GitHub Desktop.
controller.hears(
['xin chào', 'chào mày'],
['direct_message', 'direct_mention', 'mention'],
function(bot, message) {
controller.storage.users.get(message.user, function(err, user) {
if (user && user.name) {
bot.reply(message, 'ờ chào ' + user.name + '!')
} else {
bot.reply(message, 'chào!')
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment