diff options
-rw-r--r-- | src/listeners/message/automodUpdate.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/listeners/message/automodUpdate.ts b/src/listeners/message/automodUpdate.ts index c96a5a9..d2e6f40 100644 --- a/src/listeners/message/automodUpdate.ts +++ b/src/listeners/message/automodUpdate.ts @@ -1,4 +1,4 @@ -import { AutoMod, BushListener, type BushClientEvents, type BushMessage } from '#lib'; +import { AutoMod, BushListener, type BushClientEvents } from '#lib'; export default class AutomodMessageUpdateListener extends BushListener { public constructor() { @@ -10,7 +10,8 @@ export default class AutomodMessageUpdateListener extends BushListener { } public override async exec(...[_, newMessage]: BushClientEvents['messageUpdate']) { - const fullMessage = newMessage.partial ? await newMessage.fetch() : (newMessage as BushMessage); + const fullMessage = newMessage.partial ? await newMessage.fetch().catch(() => null) : newMessage; + if (!fullMessage) return; return new AutoMod(fullMessage); } } |