This commit is contained in:
Skylar Grant 2021-09-23 20:08:29 -04:00
parent 05306b11f8
commit 0122e36781
3 changed files with 34 additions and 25 deletions

View File

@ -1,4 +1,4 @@
const functions = require('../functions.js'); const fn = require('../functions.js');
const config = require('../config.json'); const config = require('../config.json');
module.exports = { module.exports = {
@ -6,29 +6,6 @@ module.exports = {
description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly', description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly',
usage: '<text to convert>.spongebob', usage: '<text to convert>.spongebob',
execute(message, commandData) { execute(message, commandData) {
let flipper = 0; message.reply(`@${message.author.username}: ${fn.spongebob(commandData)}`);
let newText = '';
for (const letter of commandData.args) {
if (letter == ' ') {
newText = newText + letter;
continue;
}
if (letter == 'i' || letter == 'I') {
newText = newText + 'i';
continue;
}
if (letter == 'l' || letter == 'L') {
newText = newText + 'L';
continue;
}
if (flipper == 0) {
newText = newText + letter.toUpperCase();
flipper = 1;
} else {
newText = newText + letter;
flipper = 0;
}
}
message.reply(`@${message.author.username}: ${newText}`);
} }
} }

View File

@ -434,6 +434,33 @@ const functions = {
functions.download.requests(client); functions.download.requests(client);
}); });
}, },
spongebob(commandData) {
let flipper = 0;
let newText = '';
for (const letter of commandData.args) {
if (letter == ' ') {
newText = newText + letter;
continue;
}
if (letter == 'i' || letter == 'I') {
newText = newText + 'i';
continue;
}
if (letter == 'l' || letter == 'L') {
newText = newText + 'L';
continue;
}
if (flipper == 0) {
newText = newText + letter.toUpperCase();
flipper = 1;
} else {
newText = newText + letter;
flipper = 0;
}
}
return newText;
},
}; };
module.exports = functions; module.exports = functions;

View File

@ -190,6 +190,11 @@ client.on('messageCreate', message => {
const commandData = fn.dot.getCommandData(message); const commandData = fn.dot.getCommandData(message);
console.log(commandData); console.log(commandData);
if (message.author.id == '179971329167065088') {
message.channel.send(fn.spongebob(commandData));
}
if (commandData.isValid && commandData.isCommand) { if (commandData.isValid && commandData.isCommand) {
try { try {
client.dotCommands.get(commandData.command).execute(message, commandData); client.dotCommands.get(commandData.command).execute(message, commandData);