feat: update

- update deps
- node-fetch v3 > v2
- ...
This commit is contained in:
Elysia
2023-03-21 18:47:11 +07:00
parent e98fa2c7f3
commit 3e5058c828
8 changed files with 895 additions and 289 deletions

View File

@@ -9,9 +9,7 @@ const getUUID = () =>
// eslint-disable-next-line
const checkUrl = url => {
try {
// eslint-disable-next-line no-new
new URL(url);
return true;
return new URL(url);
} catch {
return false;
}
@@ -194,7 +192,7 @@ class RichPresence {
if (!(this.assets instanceof Object)) this.assets = {};
if (typeof image != 'string') {
image = null;
} else if (checkUrl(image)) {
} else if (['http:', 'https:'].includes(checkUrl(image)?.protocol)) {
// Discord URL:
image = image
.replace('https://cdn.discordapp.com/', 'mp:')
@@ -231,7 +229,7 @@ https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Documents/RichP
if (!(this.assets instanceof Object)) this.assets = {};
if (typeof image != 'string') {
image = null;
} else if (checkUrl(image)) {
} else if (['http:', 'https:'].includes(checkUrl(image)?.protocol)) {
// Discord URL:
image = image
.replace('https://cdn.discordapp.com/', 'mp:')