mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 02:33:06 +00:00
chore(bot): fixed remaining issues
This commit is contained in:
parent
7c2a99daf5
commit
77c4b75440
5 changed files with 29 additions and 17 deletions
|
@ -22,7 +22,7 @@ const command: OptionsCommand = {
|
|||
execute: async (interaction) => {
|
||||
if (!interaction.isChatInputCommand() || !interaction.guild) return;
|
||||
|
||||
interaction.deferReply({ flags: ['Ephemeral'] });
|
||||
await interaction.deferReply({ flags: ['Ephemeral'] });
|
||||
|
||||
try {
|
||||
const userId = interaction.options.get('userid')?.value as string;
|
||||
|
@ -38,6 +38,7 @@ const command: OptionsCommand = {
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const ban = await interaction.guild.bans.fetch(userId);
|
||||
if (!ban) {
|
||||
|
@ -64,7 +65,7 @@ const command: OptionsCommand = {
|
|||
content: `<@${userId}> has been unbanned. Reason: ${reason}`,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(`Unable to unban user: ${error}`);
|
||||
await interaction.editReply({
|
||||
content: 'Unable to unban user.',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue