oop
This commit is contained in:
parent
05306b11f8
commit
0122e36781
@ -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: '<text to convert>.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)}`);
|
||||
}
|
||||
}
|
27
functions.js
27
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;
|
5
main.js
5
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);
|
||||
|
Loading…
Reference in New Issue
Block a user