From 66b93dd31c645ebe6aed69efcd2cc39bffaa3f40 Mon Sep 17 00:00:00 2001
From: Dragory <2606411+Dragory@users.noreply.github.com>
Date: Sun, 17 Oct 2021 19:56:04 +0300
Subject: [PATCH] chore: clean up unnecessary cache.get ?? fetch

---
 backend/src/plugins/Automod/events/runAutomodOnMessage.ts | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/backend/src/plugins/Automod/events/runAutomodOnMessage.ts b/backend/src/plugins/Automod/events/runAutomodOnMessage.ts
index 8821d803..9d6cb599 100644
--- a/backend/src/plugins/Automod/events/runAutomodOnMessage.ts
+++ b/backend/src/plugins/Automod/events/runAutomodOnMessage.ts
@@ -13,12 +13,8 @@ export async function runAutomodOnMessage(
   message: SavedMessage,
   isEdit: boolean,
 ) {
-  const member =
-    pluginData.guild.members.cache.get(message.user_id) ??
-    (await pluginData.guild.members.fetch(message.user_id).catch(() => undefined));
-  const user =
-    pluginData.client.users.cache.get(message.user_id) ??
-    (await pluginData.client.users.fetch(message.user_id).catch(() => undefined));
+  const member = await pluginData.guild.members.fetch(message.user_id).catch(() => undefined);
+  const user = await pluginData.client.users.fetch(message.user_id).catch(() => undefined);
 
   const context: AutomodContext = {
     timestamp: moment.utc(message.posted_at).valueOf(),