From 68c1f7a8db5b6634d9d7889a683c310f32fe5c56 Mon Sep 17 00:00:00 2001 From: Inbestigator Date: Thu, 7 Mar 2024 17:25:36 -0800 Subject: [PATCH] Fixed mentioned checks --- src/plugins/bypassDND/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/bypassDND/index.tsx b/src/plugins/bypassDND/index.tsx index 620aebde4..72a5dcf7d 100644 --- a/src/plugins/bypassDND/index.tsx +++ b/src/plugins/bypassDND/index.tsx @@ -9,7 +9,7 @@ import { DataStore, Notifications } from "@api/index"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { ChannelStore, Menu, NavigationRouter, PresenceStore, PrivateChannelsStore, UserStore } from "@webpack/common"; +import { ChannelStore, Menu, MessageStore, NavigationRouter, PresenceStore, PrivateChannelsStore, UserStore } from "@webpack/common"; import { type Channel, type Guild, type Message, type User } from "discord-types/general"; interface ContextProps { @@ -90,6 +90,7 @@ const ChannelContext: NavContextMenuPatchCallback = (children, { channel }: Cont const UserContext: NavContextMenuPatchCallback = (children, { user }: ContextProps) => () => { const enabled = bypasses.users.includes(user.id); + if (user.id === UserStore.getCurrentUser().id) return; children.splice(-1, 0, ( `) || message.mentions.some(mention => mention.id === currentUser.id))) { + const mentioned = MessageStore.getMessage(channelId, message.id)?.mentioned; + if ((bypasses.guilds.includes(guildId) || bypasses.channels.includes(channelId)) && mentioned) { await showNotification(message, guildId); return; } if (bypasses.users.includes(message.author.id)) { if (channelId === await PrivateChannelsStore.getOrEnsurePrivateChannel(message.author.id)) { await showNotification(message); - } else if ((message.content.includes(`<@${currentUser.id}>`) || message.mentions.some(mention => mention.id === currentUser.id)) && (settings.store.allowOutsideOfDms === true)) { + } else if (mentioned && (settings.store.allowOutsideOfDms === true)) { await showNotification(message, guildId); } }