From 1da220c5a8f37c2bae3e942ee2ff9e588972384b Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 16 Dec 2022 14:56:00 -0500 Subject: [PATCH] Improving Spongebob --- dot-commands/spongebob.js | 7 ++++++- functions.js | 17 +++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dot-commands/spongebob.js b/dot-commands/spongebob.js index 219583c..b3ba9a1 100644 --- a/dot-commands/spongebob.js +++ b/dot-commands/spongebob.js @@ -7,6 +7,11 @@ module.exports = { description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly', usage: '.spongebob', execute(message, commandData) { - message.reply(fn.spongebob(commandData)); + // message.reply(fn.spongebob(commandData)).then(() => { + // message.delete(); + // }); + message.channel.send(fn.spongebob(commandData)).then(() => { + message.delete(); + }); } } \ No newline at end of file diff --git a/functions.js b/functions.js index 243365b..5398354 100644 --- a/functions.js +++ b/functions.js @@ -506,31 +506,28 @@ const functions = { } }, spongebob(commandData) { - let flipper = 0; let newText = ''; for (const letter of commandData.args) { if (letter == ' ') { - newText = newText + letter; + newText += letter; continue; } if (letter == 'i' || letter == 'I') { - newText = newText + 'i'; + newText += 'i'; continue; } if (letter == 'l' || letter == 'L') { - newText = newText + 'L'; + newText += 'L'; continue; } - if (flipper == 0) { - newText = newText + letter.toUpperCase(); - flipper = 1; + if (Math.random() > 0.5) { + newText += letter.toUpperCase(); } else { - newText = newText + letter; - flipper = 0; + newText += letter.toLowerCase(); } } - return newText; + return newText + ' <:spongebob:1053399026709569536>'; }, };