yeaz:ú
SIASapphire - Imagine a framework
•Created by yeaz:ú on 4/23/2023 in #discordjs-support
Embed Edit command.
const { Client, Intents, MessageAttachment, MessageEmbed } = require('discord.js');
module.exports = {
name: "embed",
usage: '/embed <channel> <description> <title>',
options: [
{
name: 'channel',
description: "",
type: 'CHANNEL',
channelTypes: ["GUILD_TEXT"],
required: true
},
{
type: 3,
name: 'description',
description: "",
required: false,
},
{
type: 3,
name: 'title',
description: "",
required: false,
},
{
type: 3,
name: 'footer',
description: "",
required: false,
},
],
category: "Moderation",
description: "EMBED",
userPerms: ["ADMINISTRATOR"],
ownerOnly: false,
run: async (client, interaction) => {
const channel = interaction.options.getChannel("channel");
const description = interaction.options.getString('description');
const title = interaction.options.getString('title');
const footer = interaction.options.getString('footer');
const embed = new client.discord.MessageEmbed()
.setTitle(!title ? '' : title)
.setDescription(!description ? '' : description)
.setColor(client.config.embedColor)
.setFooter(!footer ? '' : footer)
await interaction.reply({ content: 'Done!', ephemeral: true });
return channel.send({ embeds: [embed], files: [icon] })
}
}
const { Client, Intents, MessageAttachment, MessageEmbed } = require('discord.js');
module.exports = {
name: "embed",
usage: '/embed <channel> <description> <title>',
options: [
{
name: 'channel',
description: "",
type: 'CHANNEL',
channelTypes: ["GUILD_TEXT"],
required: true
},
{
type: 3,
name: 'description',
description: "",
required: false,
},
{
type: 3,
name: 'title',
description: "",
required: false,
},
{
type: 3,
name: 'footer',
description: "",
required: false,
},
],
category: "Moderation",
description: "EMBED",
userPerms: ["ADMINISTRATOR"],
ownerOnly: false,
run: async (client, interaction) => {
const channel = interaction.options.getChannel("channel");
const description = interaction.options.getString('description');
const title = interaction.options.getString('title');
const footer = interaction.options.getString('footer');
const embed = new client.discord.MessageEmbed()
.setTitle(!title ? '' : title)
.setDescription(!description ? '' : description)
.setColor(client.config.embedColor)
.setFooter(!footer ? '' : footer)
await interaction.reply({ content: 'Done!', ephemeral: true });
return channel.send({ embeds: [embed], files: [icon] })
}
}
2 replies