Omit catch block errors when not needed

This commit is contained in:
Dragon Fire
2020-03-14 11:57:15 -04:00
parent 6794cbfdc9
commit e7dfa229f1
15 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -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!');
}
}
+1 -1
View File
@@ -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!');
}
}
+1 -1
View File
@@ -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.');
}
}
+1 -1
View File
@@ -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;
}