Add replies to spongebob

This commit is contained in:
Skylar Grant 2023-01-07 20:22:06 -05:00
parent a1f5d6d5a1
commit 73adc1036b

View File

@ -10,8 +10,21 @@ module.exports = {
// message.reply(fn.spongebob(commandData)).then(() => {
// message.delete();
// });
message.channel.send(fn.spongebob(commandData)).then(() => {
message.delete();
});
if (message.reference != undefined) {
const repliedMessageId = message.reference.messageId;
message.channel.messages.fetch(repliedMessageId)
.then(repliedMessage => {
repliedMessage.reply(fn.spongebob({ args: repliedMessage.content })).then(() => {
message.delete();
});
})
.catch(err => {
console.error(err);
});
} else {
message.channel.send(fn.spongebob(commandData)).then(() => {
message.delete();
});
}
}
}