Update FriendNotifications.plugin.js

This commit is contained in:
Mirco Wittrien 2023-11-04 19:53:40 +01:00 committed by GitHub
parent 4f914db899
commit fd647eb678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* @name FriendNotifications
* @author DevilBro
* @authorId 278543574059057154
* @version 1.9.7
* @version 1.9.8
* @description Shows a Notification when a Friend or a User, you choose to observe, changes their Status
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -706,9 +706,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, body) => {
if (error) BDFDB.NotificationUtils.toast("Could not fetch File, please make sure the File exists", {type: "danger"});
else successSavedAudio(key, source, `data:audio/mpeg;base64,${btoa(BDFDB.DiscordUtils.bufferToString(buffer))}`);
else successSavedAudio(key, source, `data:audio/mpeg;base64,${btoa(body)}`);
});
},
children: BDFDB.LanguageUtils.LanguageStrings.SAVE