From 4f914db899af7cbfcde2cf0c42bc168e22edb8a6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sat, 4 Nov 2023 19:52:08 +0100 Subject: [PATCH] Update NotificationSounds.plugin.js --- Plugins/NotificationSounds/NotificationSounds.plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index 36a32af349..4546ae38b6 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.6 + * @version 3.8.7 * @description Allows you to replace the native Sounds with custom Sounds * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -435,9 +435,9 @@ module.exports = (_ => { } BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type: "danger"}); }); - else BDFDB.LibraryRequires.fs.readFile(source, "", (error, buffer) => { + else BDFDB.LibraryRequires.fs.readFile(source, "utf8", (error, buffer) => { if (error) BDFDB.NotificationUtils.toast("Could not fetch file. Please make sure the file exists.", {type: "danger"}); - else return successSavedAudio({category, sound, source: `data:audio/mpeg;base64,${btoa(BDFDB.DiscordUtils.bufferToString(buffer))}`}); + else return successSavedAudio({category, sound, source: `data:audio/mpeg;base64,${btoa(body)}`}); }); }, children: BDFDB.LanguageUtils.LanguageStrings.SAVE