add 'bruh' intent and random award multiplier

This commit is contained in:
Jan 2020-12-30 16:24:31 +01:00
parent bace97c0f0
commit 6cb0156106

View file

@ -33,7 +33,7 @@ module.exports.execute = function(message) {
switch(action.name) { switch(action.name) {
case 'awardspam': case 'awardspam':
// Disabled for "karma balancing reasons" // Disabled for "karma balancing reasons"
randomAward(); randomAward(1.1);
return; return;
// Spam a fuckton of awards // Spam a fuckton of awards
@ -54,8 +54,11 @@ module.exports.execute = function(message) {
message.react('719181283774955540'); message.react('719181283774955540');
karmaDB.dec(message.author.id); karmaDB.dec(message.author.id);
break; break;
case 'bruh':
message.react('730882526259707997');
break;
default: default:
randomAward(); randomAward(1);
break; break;
} }
}) })
@ -63,12 +66,13 @@ module.exports.execute = function(message) {
console.error(error); console.error(error);
message.channel.send('Wit.ai error:\n' + 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 // 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) { if (message.content.toLowerCase().indexOf('obamium') > -1 || message.content.toLowerCase().indexOf('obama') > -1) {
return message.react('716021350883393566').catch(); 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 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.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 else if (randomNum > 99) {message.react('731192829262692372').catch(); coinsDB.set(message.author.id, (coinsDB.get(message.author.id) + 100)) } // Gold