diff --git a/src/structures/RichPresence.js b/src/structures/RichPresence.js index a60f637..eca54e4 100644 --- a/src/structures/RichPresence.js +++ b/src/structures/RichPresence.js @@ -7,7 +7,15 @@ const getUUID = () => ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, a => (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)); // Function check url valid (ok copilot) // eslint-disable-next-line -const checkUrl = url => /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(url); +const checkUrl = url => { + try { + // eslint-disable-next-line no-new + new URL(url); + return true; + } catch { + return false; + } +}; class CustomStatus { /**