mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 06:24:15 +02:00
fix(arabot): add catch if user is not banned
This commit is contained in:
parent
d42c4ce1cb
commit
722f0a53f1
@ -65,7 +65,16 @@ class UnbanCommand extends Command {
|
||||
}
|
||||
|
||||
// Unban the user
|
||||
await guild.members.unban(user);
|
||||
try {
|
||||
await guild.members.unban(user);
|
||||
} catch {
|
||||
await interaction.reply({
|
||||
content: `${user} is not banned.`,
|
||||
ephemeral: true,
|
||||
fetchReply: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
content: `${user} has been unbanned.`,
|
||||
@ -119,7 +128,15 @@ class UnbanCommand extends Command {
|
||||
}
|
||||
|
||||
// Unban the user
|
||||
await guild.members.unban(user);
|
||||
try {
|
||||
await guild.members.unban(user);
|
||||
} catch {
|
||||
await message.react('❌');
|
||||
await message.reply({
|
||||
content: `${user} is not banned.`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await message.react('✅');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user