nodbot/dot-commands/spongebob.js

30 lines
870 B
JavaScript
Raw Normal View History

2021-09-24 00:08:29 +00:00
const fn = require('../functions.js');
2021-09-22 17:15:31 +00:00
const config = require('../config.json');
module.exports = {
name: 'spongebob',
2022-06-11 14:55:25 +00:00
alias: 'sb',
2021-09-22 17:15:31 +00:00
description: 'SpOnGeBoB-iFy AnYtHiNg AuToMaTiCaLly',
usage: '<text to convert>.spongebob',
execute(message, commandData) {
2022-12-16 19:56:00 +00:00
// message.reply(fn.spongebob(commandData)).then(() => {
// message.delete();
// });
2023-01-08 01:22:06 +00:00
if (message.reference != undefined) {
const repliedMessageId = message.reference.messageId;
message.channel.messages.fetch(repliedMessageId)
.then(repliedMessage => {
repliedMessage.reply(fn.spongebob({ args: repliedMessage.content })).then(() => {
2023-02-13 02:22:21 +00:00
if (message.deletable) message.delete();
2023-01-08 01:22:06 +00:00
});
})
.catch(err => {
console.error(err);
});
} else {
message.channel.send(fn.spongebob(commandData)).then(() => {
2023-02-13 02:22:21 +00:00
if (message.deletable) message.delete();
2023-01-08 01:22:06 +00:00
});
}
2021-09-22 17:15:31 +00:00
}
}