Version Estable
This commit is contained in:
34
src/commands/messages/alliaces/embedDelete.ts
Normal file
34
src/commands/messages/alliaces/embedDelete.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { CommandMessage } from "../../../core/types/commands";
|
||||
|
||||
export const command: CommandMessage = {
|
||||
name: "embeddelete",
|
||||
type: "message",
|
||||
aliases: ["delembed", "removeembed"],
|
||||
cooldown: 10,
|
||||
//@ts-ignore
|
||||
run: async (message, args, client) => {
|
||||
if (!message.member?.permissions.has("Administrator")) {
|
||||
return message.reply("❌ No tienes permisos de Administrador.");
|
||||
}
|
||||
|
||||
const embedName = args[0];
|
||||
if (!embedName) {
|
||||
return message.reply("Debes proporcionar el nombre del embed a eliminar. Uso: `!embeddelete <nombre>`");
|
||||
}
|
||||
|
||||
try {
|
||||
await client.prisma.embedConfig.delete({
|
||||
where: {
|
||||
guildId_name: {
|
||||
guildId: message.guildId!,
|
||||
name: embedName,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return message.reply(`✅ El embed **${embedName}** fue eliminado con éxito.`);
|
||||
} catch {
|
||||
return message.reply("❌ No encontré un embed con ese nombre.");
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user