From 6cb01561068cbea3c7136af0376b860aefbe93d8 Mon Sep 17 00:00:00 2001 From: Jan <26145882+imverum@users.noreply.github.com> Date: Wed, 30 Dec 2020 16:24:31 +0100 Subject: [PATCH] add 'bruh' intent and random award multiplier --- util/wit.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/util/wit.js b/util/wit.js index 4ce62bd..3f5d070 100644 --- a/util/wit.js +++ b/util/wit.js @@ -33,7 +33,7 @@ module.exports.execute = function(message) { switch(action.name) { case 'awardspam': // Disabled for "karma balancing reasons" - randomAward(); + randomAward(1.1); return; // Spam a fuckton of awards @@ -54,8 +54,11 @@ module.exports.execute = function(message) { message.react('719181283774955540'); karmaDB.dec(message.author.id); break; + case 'bruh': + message.react('730882526259707997'); + break; default: - randomAward(); + randomAward(1); break; } }) @@ -63,12 +66,13 @@ module.exports.execute = function(message) { console.error(error); message.channel.send('Wit.ai error:\n' + error); }); - function randomAward() { + function randomAward(multiplier) { + if (!multiplier) multiplier = 1; // Randomly decide if the message should get a random "award" or yeet an obamium on it if (message.content.toLowerCase().indexOf('obamium') > -1 || message.content.toLowerCase().indexOf('obama') > -1) { return message.react('716021350883393566').catch(); } - const randomNum = random(0, 10000) / 100; + const randomNum = (random(0, 10000) / 100) * multiplier; if (randomNum > 99.9) {message.react('731508866273247252').catch(); coinsDB.set(message.author.id, (coinsDB.get(message.author.id) + 2500))} // Argentinum else if (randomNum > 99.5) {message.react('731192942080950333').catch(); coinsDB.set(message.author.id, (coinsDB.get(message.author.id) + 700)) } // Platinum else if (randomNum > 99) {message.react('731192829262692372').catch(); coinsDB.set(message.author.id, (coinsDB.get(message.author.id) + 100)) } // Gold