mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-16 16:12:34 +00:00
perf: don't pass errors if there's no need to
This commit is contained in:
@@ -66,7 +66,7 @@ export default commandModule({
|
||||
value: choice.id.toString(),
|
||||
}))
|
||||
)
|
||||
} catch (err) {
|
||||
} catch {
|
||||
await autocomplete.respond([{name: 'Algo malo ha ocurrido! Asegúrate que hayas puesto el ID correctamente', value: 'error'}])
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export default commandModule({
|
||||
const search = await gogoanime.fetchEpisodeServers(selepisode)
|
||||
const arrayed = await Promise.all(search.map((server) => `[${server.name}](<${server.url!.replace(doubleslashregex, '/')}>)`))
|
||||
await ctx.reply({content: `Todos los servidores de \`${selepisode}\` (Vinci no se hace cargo de los enlaces):\n${arrayed.join('\n')}`})
|
||||
} catch (err) {
|
||||
} catch {
|
||||
await ctx.reply({content: 'Ha ocurrido un error! Asegúrate que hayas seleccionado bien un capítulo.'})
|
||||
}
|
||||
} break;
|
||||
@@ -159,7 +159,7 @@ export default commandModule({
|
||||
)
|
||||
|
||||
await ctx.reply({embeds: [embed]})
|
||||
} catch (err) {
|
||||
} catch {
|
||||
await ctx.reply({content: 'Algo malo ha ocurrido, asegúrate que hayas escrito el ID correctamente\nTip: Usa el comando de buscar y conviértelos a ID.'})
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -174,7 +174,7 @@ export default commandModule({
|
||||
ephemeral: true,
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
} catch {
|
||||
await ctx.reply({
|
||||
content: `Parece que no se ha podido enviar el DM...`,
|
||||
ephemeral: true,
|
||||
|
||||
@@ -29,7 +29,7 @@ export default commandModule({
|
||||
const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel
|
||||
await sendToMods.send({content: `Se ha baneado a ${userToBan}.\nBan efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
await ctx.reply({content: 'Baneado correctamente!', ephemeral: true})
|
||||
} catch (e) {
|
||||
} catch {
|
||||
await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ export default commandModule({
|
||||
const channel = await guild.channels.fetch(ctx.channel!.id);
|
||||
(await (channel as TextChannel).messages.fetch(idMensaje)).delete();
|
||||
await ctx.reply({content: 'Mensaje eliminado correctamente.', ephemeral: true});
|
||||
} catch (e) {
|
||||
} catch {
|
||||
await ctx.reply({content: `ERROR: No se ha podido eliminar el mensaje, asegúrate que estás usando el ID y el canal correcto.`})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ export default commandModule({
|
||||
const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel
|
||||
await sendToMods!.send({content: `Se ha expulsado a ${userToKick}.\nKick efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
await ctx.reply({content: 'Expulsado correctamente!'})
|
||||
} catch (e) {
|
||||
} catch {
|
||||
await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ export default commandModule({
|
||||
await ctx.reply({content: `Se han eliminado ${amount} mensajes.`})
|
||||
const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel
|
||||
await sendToMods.send({content: `Se han eliminado ${amount} mensajes en ${ctx.channel}\nEfectuado por ${ctx.user}.`})
|
||||
} catch (e){
|
||||
} catch {
|
||||
ctx.reply({content: 'Ha habido un error eliminando mensajes! Error reportado automáticamente.', ephemeral: true})};
|
||||
}
|
||||
});
|
||||
@@ -33,7 +33,7 @@ export default commandModule({
|
||||
ctx.reply({content: `Se han añadido ${seconds} segundos de modo lento al canal de voz actual`})
|
||||
const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel
|
||||
await sendToMods.send({content: `Se ha aplicado modo lento al canal ${ctx.channel}.\nEfectuado por ${ctx.user} con ${seconds} segundos de retardo.\nRazón: ${reason}`})
|
||||
} catch (e) {
|
||||
} catch {
|
||||
ctx.reply({content: `No se ha podido aplicar modo lento al canal.`})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ export default commandModule({
|
||||
usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})})
|
||||
const sendToMods = ctx.client.guilds.cache.get(process.env.GUILDID!)!.channels.cache.get(process.env.MODLOGS_CHANNEL!) as TextChannel
|
||||
await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} minutos de duración.\nRazón: ${razon}`})
|
||||
} catch (e) {
|
||||
} catch {
|
||||
await ctx.reply({content: `ERROR: No puedo hacer este comando porque a lo mejor soy inferior que el rol de esa persona o estoy usándolo contra admins.`})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -29,5 +29,5 @@ export default async function twitternotifications(client: Client) {
|
||||
});
|
||||
message.react('<:Pog:1030169609178976346>');
|
||||
}
|
||||
} catch (err) {}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user