feat: RichPresence support protocol

This commit is contained in:
Elysia 2023-03-19 18:49:24 +07:00
parent 456644b16b
commit da5479b901

View File

@ -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 {
/**