diff --git a/dot-commands/spongebob.js b/dot-commands/spongebob.js index d4bdaa9..db9d445 100644 --- a/dot-commands/spongebob.js +++ b/dot-commands/spongebob.js @@ -1,4 +1,4 @@ -const functions = require('../functions.js'); +const fn = require('../functions.js'); const config = require('../config.json'); module.exports = { @@ -6,29 +6,6 @@ module.exports = { description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly', usage: '.spongebob', execute(message, 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; - } - } - message.reply(`@${message.author.username}: ${newText}`); + message.reply(`@${message.author.username}: ${fn.spongebob(commandData)}`); } } \ No newline at end of file diff --git a/functions.js b/functions.js index 126f583..07d9f1d 100644 --- a/functions.js +++ b/functions.js @@ -434,6 +434,33 @@ const functions = { 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; \ No newline at end of file diff --git a/main.js b/main.js index 7c235b5..3889923 100644 --- a/main.js +++ b/main.js @@ -190,6 +190,11 @@ client.on('messageCreate', message => { const commandData = fn.dot.getCommandData(message); console.log(commandData); + + if (message.author.id == '179971329167065088') { + message.channel.send(fn.spongebob(commandData)); + } + if (commandData.isValid && commandData.isCommand) { try { client.dotCommands.get(commandData.command).execute(message, commandData);