Update NotificationSounds.plugin.js
This commit is contained in:
parent
45ceb7bfd1
commit
3e7ea9eb7c
|
@ -2,7 +2,7 @@
|
||||||
* @name NotificationSounds
|
* @name NotificationSounds
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 3.9.6
|
* @version 3.9.7
|
||||||
* @description Allows you to replace the native Sounds with custom Sounds
|
* @description Allows you to replace the native Sounds with custom Sounds
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -426,7 +426,6 @@ module.exports = (_ => {
|
||||||
className: "input-newsound input-source",
|
className: "input-newsound input-source",
|
||||||
type: "file",
|
type: "file",
|
||||||
filter: ["audio", "video"],
|
filter: ["audio", "video"],
|
||||||
useFilePath: true,
|
|
||||||
value: "",
|
value: "",
|
||||||
placeholder: "Source"
|
placeholder: "Source"
|
||||||
})
|
})
|
||||||
|
@ -446,10 +445,7 @@ 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"});
|
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, "base64", (error, body) => {
|
else if (source.indexOf("data:") == 0) return successSavedAudio({category, sound, source: source});
|
||||||
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,${body}`});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
children: BDFDB.LanguageUtils.LanguageStrings.SAVE
|
children: BDFDB.LanguageUtils.LanguageStrings.SAVE
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue