Merge pull request #9 from voidf1sh:dev

Improving Spongebob
This commit is contained in:
Skylar Grant 2022-12-16 14:57:33 -05:00 committed by GitHub
commit aaf1bd2c17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -7,6 +7,11 @@ module.exports = {
description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly',
usage: '<text to convert>.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();
});
}
}

View File

@ -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>';
},
};