Improving Spongebob
This commit is contained in:
parent
ff4c3f47cf
commit
1da220c5a8
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
17
functions.js
17
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>';
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user