From 0f042bc3422ae1d0185336968ab5b7512dbf535f Mon Sep 17 00:00:00 2001 From: Inbestigator Date: Wed, 6 Mar 2024 07:51:53 -0800 Subject: [PATCH] Cleaned up the flux function a bit --- src/plugins/bypassdnd/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/bypassdnd/index.tsx b/src/plugins/bypassdnd/index.tsx index d5e14ecc2..c076ad135 100644 --- a/src/plugins/bypassdnd/index.tsx +++ b/src/plugins/bypassdnd/index.tsx @@ -117,11 +117,11 @@ export default definePlugin({ async MESSAGE_CREATE({ optimistic, type, message, guildId, channelId }: IMessageCreate) { if (optimistic || type !== "MESSAGE_CREATE") return; if (message.state === "SENDING") return; - if (message.author.id === UserStore.getCurrentUser().id) return; if (!message.content) return; - if (await PresenceStore.getStatus(UserStore.getCurrentUser().id) != 'dnd') return; - - if ((bypasses.guilds.includes(guildId) || bypasses.channels.includes(channelId)) && (message.content.includes(`<@${UserStore.getCurrentUser().id}>`) || message.mentions.some(mention => mention.id === UserStore.getCurrentUser().id))) { + const currentUser = UserStore.getCurrentUser(); + if (message.author.id === currentUser.id) return; + if (await PresenceStore.getStatus(currentUser.id) != 'dnd') return; + if ((bypasses.guilds.includes(guildId) || bypasses.channels.includes(channelId)) && (message.content.includes(`<@${currentUser.id}>`) || message.mentions.some(mention => mention.id === currentUser.id))) { await Notifications.showNotification({ title: `${message.author.globalName ?? message.author.username} sent a message in ${ChannelStore.getChannel(channelId).name}`, body: message.content,