AeThex-Bot-Master/aethex-bot/commands/embed.js
sirpiglr 6f5c37959f Add new commands and improve existing ones for better user experience
Introduces new commands like `/automod`, `/giveaway`, `/rolepanel`, and `/schedule`. Enhances existing commands such as `/announce`, `/help`, `/leaderboard`, `/profile`, and `/serverinfo` with new features and improved embed designs. Updates welcome and goodbye listeners with rich embeds. Fixes a critical issue in the `/rolepanel` command regarding channel fetching. Adds interaction handling for role buttons and giveaway entries.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: eefee140-1301-4b6f-9439-2b0b883aa40a
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/qAaysIh
Replit-Helium-Checkpoint-Created: true
2025-12-08 07:24:49 +00:00

97 lines
3.3 KiB
JavaScript

const {
SlashCommandBuilder,
EmbedBuilder,
PermissionFlagsBits,
ModalBuilder,
TextInputBuilder,
TextInputStyle,
ActionRowBuilder,
ChannelType
} = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('embed')
.setDescription('Create a custom embed message')
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages)
.addChannelOption(option =>
option.setName('channel')
.setDescription('Channel to send the embed to')
.setRequired(true)
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
)
.addStringOption(option =>
option.setName('color')
.setDescription('Embed color')
.setRequired(false)
.addChoices(
{ name: '🟣 Purple (Default)', value: '7c3aed' },
{ name: '🟢 Green (Success)', value: '22c55e' },
{ name: '🔴 Red (Alert)', value: 'ef4444' },
{ name: '🔵 Blue (Info)', value: '3b82f6' },
{ name: '🟡 Yellow (Warning)', value: 'eab308' },
{ name: '🟠 Orange (Highlight)', value: 'f97316' },
{ name: '⚪ White', value: 'ffffff' },
{ name: '⚫ Black', value: '1f2937' },
{ name: '🩷 Pink', value: 'ec4899' },
{ name: '🩵 Cyan', value: '06b6d4' }
)
),
async execute(interaction, supabase, client) {
const channel = interaction.options.getChannel('channel');
const color = interaction.options.getString('color') || '7c3aed';
const modal = new ModalBuilder()
.setCustomId(`embed_modal_${channel.id}_${color}`)
.setTitle('Create Custom Embed');
const titleInput = new TextInputBuilder()
.setCustomId('embed_title')
.setLabel('Title')
.setStyle(TextInputStyle.Short)
.setPlaceholder('Enter embed title')
.setMaxLength(256)
.setRequired(true);
const descriptionInput = new TextInputBuilder()
.setCustomId('embed_description')
.setLabel('Description')
.setStyle(TextInputStyle.Paragraph)
.setPlaceholder('Enter embed description (supports markdown)')
.setMaxLength(4000)
.setRequired(true);
const imageInput = new TextInputBuilder()
.setCustomId('embed_image')
.setLabel('Image URL (optional)')
.setStyle(TextInputStyle.Short)
.setPlaceholder('https://example.com/image.png')
.setRequired(false);
const thumbnailInput = new TextInputBuilder()
.setCustomId('embed_thumbnail')
.setLabel('Thumbnail URL (optional)')
.setStyle(TextInputStyle.Short)
.setPlaceholder('https://example.com/thumbnail.png')
.setRequired(false);
const footerInput = new TextInputBuilder()
.setCustomId('embed_footer')
.setLabel('Footer text (optional)')
.setStyle(TextInputStyle.Short)
.setPlaceholder('Enter footer text')
.setMaxLength(2048)
.setRequired(false);
const row1 = new ActionRowBuilder().addComponents(titleInput);
const row2 = new ActionRowBuilder().addComponents(descriptionInput);
const row3 = new ActionRowBuilder().addComponents(imageInput);
const row4 = new ActionRowBuilder().addComponents(thumbnailInput);
const row5 = new ActionRowBuilder().addComponents(footerInput);
modal.addComponents(row1, row2, row3, row4, row5);
await interaction.showModal(modal);
},
};