const { EmbedBuilder } = require('discord.js'); module.exports = { name: "me", debug: false, global: false, description: "Send a message stating your characters action", usage: "[action]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], member: [], }, options: [ { name: "action", description: "Message to state your action", value: "action", type: 3, required: true, }, ], SlashCommand: { /** * * @param {require("../structures/QuarksBot")} client * @param {import("discord.js").Message} 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 EmbedBuilder() .setColor(client.config.Colors.Default) .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 EmbedBuilder() .setDescription(`**Internal Error:** ${err}\nThe channel may have been deleted\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`) .setColor(client.config.Colors.Red) return interaction.send({ embeds: [embed] }); } try { channel.send({ embeds: [actionEmbed] }); } catch (err) { return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `) } return interaction.send('Action performed'); } else { return interaction.send({ content: 'Action performed', embeds: [actionEmbed] }); } }, }, }