Updated unban command

This commit is contained in:
2023-12-04 11:22:57 +01:00
parent dff052be40
commit e0cf09c936
2 changed files with 17 additions and 1 deletions

View File

@@ -37,6 +37,16 @@ module.exports = {
const mod = interaction.user
const embedColor = Number(color.replace("#", "0x"))
if (userid === "none") {
await interaction.editReply({
embeds: [{
description: "You haven't specified a user to unban",
color: embedColor
}]
})
return
}
const user = await interaction.client.users.fetch(userid)
await interaction.guild.members.unban(user.id, reason)

View File

@@ -11,7 +11,13 @@ module.exports = {
const focusedOption = interaction.options.getFocused(true)
if (focusedOption.name !== "user") return
console.log
if (focusedOption.value === "") {
await interaction.respond([{
name: "Please start typing a username to unban",
value: "none"
}])
return
}
const bannedUsers = await interaction.guild.bans.fetch()
const filteredUsers = bannedUsers.filter((user) =>