mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-28 03:22:18 +00:00
fix: send to modlogs AFTER it has been done
at the beginning, the message was sent BEFORE doing the moderation action, which caused errors to happen after the message was sent to modlogs
This commit is contained in:
@@ -24,9 +24,9 @@ export default commandModule({
|
||||
execute: async (ctx, options, message) => {
|
||||
const userToBan = options[1].getMember('usuario', true);
|
||||
const reason = options[1].get('razon', true).value;
|
||||
userToBan.ban(reason)
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
await sendToMods.send({content: `Se ha baneado a ${userToBan}.\nBan efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
userToBan.ban(reason)
|
||||
await ctx.reply({content: 'Baneado correctamente!', ephemeral: true})
|
||||
},
|
||||
});
|
||||
@@ -29,9 +29,9 @@ export default commandModule({
|
||||
const kickEmbed = new EmbedBuilder()
|
||||
.setTitle('Nuevo kick.')
|
||||
.setDescription(`Kick efectuado por <@${ctx.author}>.\nRazón: ${reason}.`);
|
||||
userToBan.kick(reason)
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
await sendToMods.send({content: `Se ha expulsado a ${userToBan}.\nKick efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
userToBan.kick(reason)
|
||||
await ctx.reply({content: 'Expulsado correctamente!'})
|
||||
},
|
||||
});
|
||||
@@ -40,10 +40,9 @@ export default commandModule({
|
||||
const razon = options[1].getString('razon', true);
|
||||
const minutosToMilisegundos = minutos * 60 * 1000
|
||||
|
||||
usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})})
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} minutos de duración.\nRazón: ${razon}`})
|
||||
|
||||
usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})})
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user