aboutsummaryrefslogtreecommitdiff
path: root/src/lib/common/AutoMod.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-31 22:38:06 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-31 22:38:06 -0400
commitc40a94697d64962edda41345e03fa76f51aa431c (patch)
tree1e258d51d6b19b9918f1d478b3f4c51dca3adc93 /src/lib/common/AutoMod.ts
parent901d9dfc8c5d95b8c76519e700c624294d4df787 (diff)
downloadtanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.gz
tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.bz2
tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.zip
upgrade typescript, improve workflow, bunch of bug fixes and some other things
Diffstat (limited to 'src/lib/common/AutoMod.ts')
-rw-r--r--src/lib/common/AutoMod.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts
index 38c488b..c749a33 100644
--- a/src/lib/common/AutoMod.ts
+++ b/src/lib/common/AutoMod.ts
@@ -1,10 +1,8 @@
-import { GuildMember, MessageActionRow, MessageButton, MessageEmbed, TextChannel } from 'discord.js';
+import { Moderation, type BushButtonInteraction, type BushMessage } from '@lib';
+import { GuildMember, MessageActionRow, MessageButton, MessageEmbed, type TextChannel } from 'discord.js';
import badLinksArray from '../badlinks';
import badLinksSecretArray from '../badlinks-secret'; // I cannot make this public so just make a new file that export defaults an empty array
import badWords from '../badwords';
-import { BushButtonInteraction } from '../extensions/discord.js/BushButtonInteraction';
-import { BushMessage } from '../extensions/discord.js/BushMessage';
-import { Moderation } from './Moderation';
export class AutoMod {
private message: BushMessage;
@@ -190,7 +188,7 @@ export class AutoMod {
const [action, userId, reason] = interaction.customId.replace('automod;', '').split(';');
switch (action) {
case 'ban': {
- const victim = await interaction.guild!.members.fetch(userId);
+ const victim = await interaction.guild!.members.fetch(userId).catch(() => null);
const moderator =
interaction.member instanceof GuildMember
? interaction.member