From 77a382b990efe9742d3fe1e5534c3782de3cd631 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 10 Feb 2023 19:13:56 -0800 Subject: [PATCH] Some tweaks here and there --- src/events/messageDeleteBulk.ts | 6 +++--- src/schoolClassroom.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/events/messageDeleteBulk.ts b/src/events/messageDeleteBulk.ts index ae5ea39..c43cd72 100644 --- a/src/events/messageDeleteBulk.ts +++ b/src/events/messageDeleteBulk.ts @@ -2,10 +2,10 @@ import Discord from 'discord.js'; import TClient from '../client'; export default { async run(client:TClient, messages:Discord.Collection>){ - const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel; if (!client.config.botSwitches.logs) return; - if ((client.guilds.cache.get('929807948748832798') as Discord.Guild)?.id != client.config.mainServer.id) return; - const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${messages.map((msgs)=>`${msgs.member.displayName}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``).addFields({name: 'Channel', value: `<#${(messages.first() as Discord.Message).channel.id}>`}); + if (client.config.mainServer.id != '468835415093411861') return; + const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel; + const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${messages.map((msgs)=>`${msgs.member.displayName}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``).addFields({name: 'Channel', value: `<#${messages.first().channel.id}>`}); channel.send({embeds: [embed]}) } } \ No newline at end of file diff --git a/src/schoolClassroom.ts b/src/schoolClassroom.ts index e2cea72..42b5964 100644 --- a/src/schoolClassroom.ts +++ b/src/schoolClassroom.ts @@ -90,7 +90,7 @@ export class punishments extends Database { if (data.cancels) embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id}\n\`${cancels.reason}\``}); // send embed in modlog channel - (this.client.channels.cache.get(channelId) as Discord.TextChannel).send({embeds: [embed]}); + (this.client.channels.resolve(channelId) as Discord.TextChannel).send({embeds: [embed]}); }; getTense(type: string) { // Get past tense form of punishment type, grammar yes switch (type) { @@ -141,7 +141,7 @@ export class punishments extends Database { if (['ban', 'softban'].includes(type)) { const banned = await guild.bans.fetch(User.id).catch(() => undefined); if (!banned) { - punResult = await guild.bans.create(User.id, {reason: `${reason} | Case #${punData.id}`}).catch((err: Error) => err.message); + punResult = await guild.bans.create(User.id, {reason: `${reason} | Case #${punData.id}`, deleteMessageSeconds: 172800}).catch((err: Error) => err.message); } else { punResult = 'User is already banned.'; }