From e635e864e00a455e28dadae06173f398aa2c94c3 Mon Sep 17 00:00:00 2001 From: Kokiwi Date: Tue, 9 Apr 2019 15:14:12 +0200 Subject: [PATCH] tacobot now stops talking. He just adds a reaction --- bot.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/bot.js b/bot.js index 4d16fbb..6f5f7ee 100644 --- a/bot.js +++ b/bot.js @@ -11,20 +11,21 @@ const forTaco = controller => { const senderIndex = ids.indexOf(message.user); const tacosGiven = parser.countTacos(message.text); if (userIndex > -1 && userIndex !== senderIndex) { - const user = DB.getUser(userIndex); const giver = DB.getUser(senderIndex); if (giver.left >= tacosGiven) { taco.giveTaco(userIndex, tacosGiven); taco.removeLeft(senderIndex, tacosGiven); - bot.reply( - message, - `Congratz ! <@${user.id}> now has ${user.tacos + - tacosGiven} tacos !` - ); - bot.reply( - message, - `<@${message.user}> now has ${giver.left - - tacosGiven} tacos left... Nice job guys` + bot.api.reactions.add( + { + timestamp: message.ts, + channel: message.channel, + name: "taco" + }, + function(err, res) { + if (err) { + bot.botkit.log("Failed to add emoji reaction :(", err); + } + } ); } else { bot.reply(