From a9d17d5c27947c4973f0b1f659952ef5586c7927 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 25 Jan 2024 21:28:17 +0100 Subject: [PATCH] Update NotificationSounds.plugin.js --- Plugins/NotificationSounds/NotificationSounds.plugin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index df15451b46..2287d61c83 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -2,7 +2,7 @@ * @name NotificationSounds * @author DevilBro * @authorId 278543574059057154 - * @version 3.8.9 + * @version 3.9.0 * @description Allows you to replace the native Sounds with custom Sounds * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -257,6 +257,8 @@ module.exports = (_ => { if (message.author.id != BDFDB.UserUtils.me.id && !BDFDB.LibraryStores.RelationshipStore.isBlocked(message.author.id) && (BDFDB.LibraryStores.SelectedChannelStore.getChannelId() != message.channel_id || !BDFDB.LibraryStores.NotificationSettingsStore.getNotifyMessagesInSelectedChannel())) { const channel = BDFDB.LibraryStores.ChannelStore.getChannel(message.channel_id); const isGroupDM = channel.isGroupDM(); + const isThread = BDFDB.ChannelUtils.isThread(channel); + if (isThread && BDFDB.LibraryStores.JoinedThreadsStore.isMuted(channel.id) || !isThread && BDFDB.LibraryStores.UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildId, channel.id)) return; if (!guildId) { this.fireEvent(isGroupDM ? "groupdm" : "dm"); this.playAudio(isGroupDM ? "groupdm" : "dm"); @@ -297,7 +299,7 @@ module.exports = (_ => { } } } - if (BDFDB.LibraryStores.UserGuildSettingsStore.allowAllMessages(channel) && !((channel.type == BDFDB.DiscordConstants.ChannelTypes.PUBLIC_THREAD || channel.type == BDFDB.DiscordConstants.ChannelTypes.PRIVATE_THREAD) && !BDFDB.LibraryStores.JoinedThreadsStore.hasJoined(BDFDB.UserUtils.me.id))) { + if (BDFDB.LibraryStores.UserGuildSettingsStore.allowAllMessages(channel) && !(isThread && !BDFDB.LibraryStores.JoinedThreadsStore.hasJoined(channel.id))) { console.log(channel); this.fireEvent("message1"); this.playAudio("message1");