I'm trying to make an unban command but when the user isn't banned and it's ran, it crashes the bot, so I'm trying to make it so it checks if the user is banned, however, I can't find out where to do that.
i tried this:
const user = interaction.options.getUser('user') const guild = client.guilds.cache.get(guildId); if (await guild.bans.fetch(user))
const user = interaction.options.getUser('user') const guild = client.guilds.cache.get(guildId); if (await guild.bans.fetch(user))
but that didn't work, saying DiscordAPIError[10026]: Unknown Ban