56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
const { MessageEmbed } = require('discord.js');
|
|
|
|
module.exports = {
|
|
name: "me",
|
|
debug: false,
|
|
description: "Send a message stating your characters action",
|
|
usage: "[action]",
|
|
permissions: {
|
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
|
member: [],
|
|
},
|
|
SlashCommand: {
|
|
options: [
|
|
{
|
|
name: "action",
|
|
description: "Message to state your action",
|
|
value: "action",
|
|
type: 3,
|
|
required: true,
|
|
},
|
|
],
|
|
/**
|
|
*
|
|
* @param {require("../structures/QuarksBot")} client
|
|
* @param {import("discord.js").MessageCreate} message
|
|
* @param {string[]} args
|
|
* @param {*} param3
|
|
*/
|
|
run: async (client, interaction, args, { GuildDB }) => {
|
|
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
|
|
return interaction.send(`You are not allowed to use the bot in this channel.`);
|
|
}
|
|
|
|
const actionEmbed = new MessageEmbed()
|
|
.setColor(client.config.EmbedColor)
|
|
.setTitle('Action Performed')
|
|
.setDescription(`<@${interaction.member.user.id}> - *${args[0].value}*`)
|
|
.setTimestamp()
|
|
|
|
if (client.exists(GuildDB.actionChannel)) {
|
|
const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.actionChannel);
|
|
if (!channel) {
|
|
const embed = new MessageEmbed()
|
|
.setDescriptions(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
|
.setColor("RED")
|
|
|
|
return interaction.send({ embeds: [embed] });
|
|
}
|
|
channel.send({ embeds: [actionEmbed] });
|
|
return interaction.send('Action performed');
|
|
} else {
|
|
return interaction.send({ content: 'Action performed', embeds: [actionEmbed] });
|
|
}
|
|
},
|
|
},
|
|
} |