mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Omit catch block errors when not needed
This commit is contained in:
@@ -47,7 +47,7 @@ module.exports = class PhoneCommand extends Command {
|
||||
this.client.phone.set(id, new PhoneCall(this.client, msg.channel, channel));
|
||||
await this.client.phone.get(id).start();
|
||||
return null;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return msg.reply('Failed to start the call. Try again later!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = class PortalSendCommand extends Command {
|
||||
const displayName = msg.channel.type === 'text' ? msg.guild.name : 'DM';
|
||||
await channel.send(`**${this.portalEmoji} ${msg.author.tag} (${displayName}):** ${message}`);
|
||||
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return msg.reply('Failed to send the message. Try again later!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class PruneCommand extends Command {
|
||||
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
|
||||
await msg.channel.bulkDelete(messages, true);
|
||||
return null;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return msg.reply('There are no messages younger than two weeks that can be deleted.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ module.exports = class RenameAllCommand extends Command {
|
||||
for (const member of msg.guild.members.cache.values()) {
|
||||
try {
|
||||
await member.setNickname(nickname);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user