From cfa6ba1d4ec2bf5aa186c6da4d78b7cb52806f9c Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 17 Mar 2022 16:00:06 +0100 Subject: [PATCH] Update NotificationSounds.plugin.js --- .../NotificationSounds/NotificationSounds.plugin.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index b04de5a069..a86da7499d 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.6.8 + * @version 3.6.9 * @description Allows you to replace the native Sounds with custom Sounds * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "NotificationSounds", "author": "DevilBro", - "version": "3.6.8", + "version": "3.6.9", "description": "Allows you to replace the native Sounds with custom Sounds" - }, - "changeLog": { - "fixed": { - "Bot Replies": "No longer plays Reply Sound when a Bot responds to a Slash Command" - } } }; @@ -286,7 +281,8 @@ module.exports = (_ => { }}); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.DesktopNotificationUtils, "showNotification", {before: e => { - if (e.methodArguments[3] && e.methodArguments[3].sound && e.methodArguments[3].sound.includes("message")) e.methodArguments[3].sound = null; + let soundObjIndex = Array.from(e.methodArguments).findIndex(n => n && n.sound); + if (soundObjIndex && e.methodArguments[soundObjIndex].sound.includes("message")) e.methodArguments[soundObjIndex].sound = null; }}); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SoundUtils, "playSound", {instead: e => { let type = e.methodArguments[0];