Added more Commands

This commit is contained in:
Noah Pombas
2025-02-13 04:42:11 +01:00
parent 216e95ee3e
commit 7860aab0e8
21 changed files with 684 additions and 253 deletions

48
commands/admin/unban.js Normal file
View File

@@ -0,0 +1,48 @@
const Discord = require("discord.js");
module.exports = {
name: 'unban',
description: '[ 🚫 Unban ] Unban a Player',
options: [
{
name: "user",
description: "User you want to unban",
type: Discord.ApplicationCommandOptionType.User,
required: true
},
],
run: async(client, interaction) => {
let noPermission = new Discord.EmbedBuilder()
.setColor('Red')
.setTitle('Permission Error!')
.setDescription(`
**Discord BOT**
Access denied for this command!
${interaction.user}`);
if (!interaction.member.permissions.has(Discord.PermissionsBitField.Flags.BanMembers)) {
interaction.reply({embeds: [noPermission], ephemeral: true})
} else {
let staff = interaction.user.displayName
let user = interaction.options.getUser("user")
let unbanSuccess = new Discord.EmbedBuilder()
.setColor('Yellow')
.setDescription(`**${user} has been unbanned from the server by ${staff}!**`)
.setFooter({text: `Responsible: ${staff}`, iconURL: interaction.user.displayAvatarURL({ format: "png" }) })
.setTimestamp(new Date())
interaction.guild.members.unban(user).then(async () => {
const channel = await interaction.guild.channels.fetch(logchannelunbans)
await interaction.reply({embeds: [unbanSuccess], ephemeral: true})
})
}
}
}