I'm building a slackbot that needs to listen for an ambient keyword but checks to make sure a particular user wrote the keyword. I'm trying to test the command right now with this:
controller.hears(['texas'], 'ambient', function(bot, message) {
username = users.info.name;
bot.reply(message, username);
});
Eventually, I want to run conditional logic to make sure a username matches the user I want the bot to respond to. This isn't working though; am I using the API wrong? How do I retrieve the username, and how do I check to make sure it's the correct user?