diff --git a/src/bot.js b/src/bot.js index c195779..e6e305f 100644 --- a/src/bot.js +++ b/src/bot.js @@ -14,6 +14,7 @@ import { helpCommand, handleHelp } from "./comandos/help.js"; import { sendLogs, sendLogsEmbed } from "./comandos/sendLogs.js"; import { showServersCommand, handleShowServers } from "./comandos/showServers.js"; import { sayEmbedCommand, handleSayEmbed } from "./comandos/send-embed.js"; +import { banCommand, handleBan } from "./comandos/ban.js"; const rawData = fs.readFileSync("./data/config.json"); const configs = JSON.parse(rawData); const date = new Date(); @@ -107,6 +108,7 @@ bot.on("interactionCreate", (interaction) => { handleHelp(interaction); handleShowServers(interaction,bot.guilds.cache); handleSayEmbed(interaction); + handleBan(interaction); }); async function main() { @@ -114,7 +116,8 @@ async function main() { pingCommand, helpCommand, showServersCommand, - sayEmbedCommand + sayEmbedCommand, + banCommand ]; try { console.log("Recarregando comandos de barra /"); diff --git a/src/comandos/ban.js b/src/comandos/ban.js index 805abaf..ed975c6 100644 --- a/src/comandos/ban.js +++ b/src/comandos/ban.js @@ -1,17 +1,33 @@ -const Discord = require("discord.js"); -const embed = new Discord.MessageEmbed(); -const {comandos, prefix} = require("../../data/config.json"); +import { SlashCommandBuilder } from "@discordjs/builders"; -module.exports.run = async (bot, message, args) => { - const novaLinha = "\n"; +let banCommand = new SlashCommandBuilder() + .setName('ban') + .setDescription('Usado para moderação do servidor') - let info = "ℹ️" + novaLinha; - - embed.setTitle(`**__BAN__**`); - embed.setColor("#00FF00"); - embed.setDescription(info); - embed.setTimestamp(); +banCommand = banCommand.toJSON(); - message.delete().catch((O_o) => {}); - message.channel.send(embed); -}; +// help.js +function handleBan(interaction) { + if (interaction.commandName === 'ban') { + const date = new Date(); + + let info = ` + Usuario X banido. + Moderador: x + Motivo: x + ` + const embed = { + title: "**__BAN__**", + description: info, + color: parseInt("FF0000", 16), + timestamp: date + }; + + interaction.reply({ embeds: [embed] }); + } +} + +export { + banCommand, + handleBan +} \ No newline at end of file