From 6ed91fe43bc668005c7ba9e7e25e45441b1487bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 1 Sep 2021 12:41:46 +0300 Subject: [PATCH 1/8] Updated Dependencies --- package-lock.json | 154 +++++++++++++++++++++++++++++++++++++++------- package.json | 4 +- 2 files changed, 134 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5cd8779..bc6db79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eximiabots-radiox", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eximiabots-radiox", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "dependencies": { "@discordjs/builders": "^0.6.0", @@ -17,7 +17,7 @@ "discord.js": "^13.1.0", "dotenv": "^10.0.0", "libsodium-wrappers": "^0.7.9", - "node-fetch": "^2.6.1", + "node-fetch": "^3.0.0", "path": "^0.12.7" }, "devDependencies": { @@ -220,6 +220,14 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@discordjs/node-pre-gyp/node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/@discordjs/opus": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz", @@ -251,6 +259,14 @@ "node": ">=16.0.0" } }, + "node_modules/@discordjs/rest/node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/@discordjs/voice": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", @@ -460,9 +476,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.7.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz", - "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg==" + "version": "16.7.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", + "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" }, "node_modules/@types/ws": { "version": "7.4.7", @@ -1159,9 +1175,9 @@ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/create-require": { "version": "1.1.1", @@ -1192,6 +1208,14 @@ "node": ">=8" } }, + "node_modules/data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "engines": { + "node": ">= 6" + } + }, "node_modules/debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -1329,6 +1353,14 @@ "npm": ">=7.0.0" } }, + "node_modules/discord.js/node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1745,6 +1777,27 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz", + "integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2542,11 +2595,19 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz", + "integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==", + "dependencies": { + "data-uri-to-buffer": "^3.0.1", + "fetch-blob": "^3.1.2" + }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/nodemon": { @@ -3782,6 +3843,14 @@ "node": ">=0.10.0" } }, + "node_modules/web-streams-polyfill": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.0.tgz", + "integrity": "sha512-wO9r1YnYe7kFBLHyyVEhV1H8VRWoNiNnuP+v/HUUmSTaRF8F93Kmd3JMrETx0f11GXxRek6OcL2QtjFIdc5WYw==", + "engines": { + "node": ">= 8" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4057,6 +4126,13 @@ "rimraf": "^3.0.2", "semver": "^7.3.5", "tar": "^6.1.8" + }, + "dependencies": { + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + } } }, "@discordjs/opus": { @@ -4081,6 +4157,13 @@ "form-data": "^4.0.0", "node-fetch": "^2.6.1", "tslib": "^2.3.0" + }, + "dependencies": { + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + } } }, "@discordjs/voice": { @@ -4236,9 +4319,9 @@ "dev": true }, "@types/node": { - "version": "16.7.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz", - "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg==" + "version": "16.7.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", + "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" }, "@types/ws": { "version": "7.4.7", @@ -4741,9 +4824,9 @@ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "create-require": { "version": "1.1.1", @@ -4768,6 +4851,11 @@ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", "dev": true }, + "data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==" + }, "debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -4864,6 +4952,11 @@ "ts-mixer": "^6.0.0", "tslib": "^2.3.0" } + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" } } }, @@ -5182,6 +5275,14 @@ "reusify": "^1.0.4" } }, + "fetch-blob": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz", + "integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==", + "requires": { + "web-streams-polyfill": "^3.0.3" + } + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -5806,9 +5907,13 @@ "dev": true }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz", + "integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==", + "requires": { + "data-uri-to-buffer": "^3.0.1", + "fetch-blob": "^3.1.2" + } }, "nodemon": { "version": "2.0.12", @@ -6723,6 +6828,11 @@ "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=" }, + "web-streams-polyfill": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.0.tgz", + "integrity": "sha512-wO9r1YnYe7kFBLHyyVEhV1H8VRWoNiNnuP+v/HUUmSTaRF8F93Kmd3JMrETx0f11GXxRek6OcL2QtjFIdc5WYw==" + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 199433f..dd11b51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eximiabots-radiox", - "version": "0.3.0", + "version": "0.3.1", "description": "Internet Radio to your Discord guild", "main": "index.js", "scripts": { @@ -26,7 +26,7 @@ "discord.js": "^13.1.0", "dotenv": "^10.0.0", "libsodium-wrappers": "^0.7.9", - "node-fetch": "^2.6.1", + "node-fetch": "^3.0.0", "path": "^0.12.7" }, "devDependencies": { From a1aa96fc2fcbea613e0e6fbe2a495506b7c57c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 1 Sep 2021 12:51:17 +0300 Subject: [PATCH 2/8] Added radio.message?.delete in voiceStateUpdate --- src/client/events/voiceStateUpdate.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/events/voiceStateUpdate.js b/src/client/events/voiceStateUpdate.js index 1ae0fa1..e6da785 100644 --- a/src/client/events/voiceStateUpdate.js +++ b/src/client/events/voiceStateUpdate.js @@ -17,6 +17,7 @@ module.exports = { client.funcs.statisticsUpdate(client, newState.guild, radio); radio.connection?.destroy(); radio.audioPlayer?.stop(); + radio.message?.delete(); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); return client.radio.delete(newState.guild.id); } @@ -39,6 +40,7 @@ module.exports = { client.funcs.statisticsUpdate(client, newState.guild, radio); radio.connection?.destroy(); radio.audioPlayer?.stop(); + radio.message?.delete(); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); client.radio.delete(oldState.guild.id); } @@ -58,6 +60,7 @@ module.exports = { client.funcs.statisticsUpdate(client, newState.guild, radio); radio.connection?.destroy(); radio.audioPlayer?.stop(); + radio.message?.delete(); client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id); client.radio.delete(newState.guild.id); } From 0858f9e49e1fd5cd20e465230bc3a1284d064d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 1 Sep 2021 13:56:54 +0300 Subject: [PATCH 3/8] Updated invite link --- src/client/commands/invite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/commands/invite.js b/src/client/commands/invite.js index 83b51a0..3158dc3 100644 --- a/src/client/commands/invite.js +++ b/src/client/commands/invite.js @@ -11,7 +11,7 @@ module.exports = { const embed = new Discord.MessageEmbed() .setTitle(message.inviteTitle) .setColor(client.config.embedColor) - .setURL("https://discordapp.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity + .setURL("https://discord.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); interaction.reply({ From 40879c85bb7252c67b169ab78f73d5bb23974150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 1 Sep 2021 17:47:12 +0300 Subject: [PATCH 4/8] Example solutions but dont work due to typescript --- src/client/events/ready.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/events/ready.js b/src/client/events/ready.js index 2213918..3f051ac 100644 --- a/src/client/events/ready.js +++ b/src/client/events/ready.js @@ -1,4 +1,4 @@ -const fetch = require('node-fetch'); +const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); module.exports = { name: 'ready', From 73857c9fc596fb13a36b11126bb74297f96c0273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Fri, 3 Sep 2021 05:31:02 +0300 Subject: [PATCH 5/8] Bumb Version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff815db..0707591 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eximiabots-radiox", - "version": "0.3.2", + "version": "0.3.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eximiabots-radiox", - "version": "0.3.2", + "version": "0.3.5", "license": "MIT", "dependencies": { "@discordjs/builders": "^0.6.0", diff --git a/package.json b/package.json index 56e9da6..33ba2e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eximiabots-radiox", - "version": "0.3.2", + "version": "0.3.5", "description": "Internet Radio to your Discord guild", "main": "index.js", "scripts": { From 190852bc164d61c86760cba17c4951bca051feb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 4 Sep 2021 13:46:10 +0300 Subject: [PATCH 6/8] Bumb version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0707591..10fb9ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eximiabots-radiox", - "version": "0.3.5", + "version": "0.3.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eximiabots-radiox", - "version": "0.3.5", + "version": "0.3.10", "license": "MIT", "dependencies": { "@discordjs/builders": "^0.6.0", diff --git a/package.json b/package.json index 33ba2e6..12182d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eximiabots-radiox", - "version": "0.3.5", + "version": "0.3.10", "description": "Internet Radio to your Discord guild", "main": "index.js", "scripts": { From ac323a541072dd9d2893bb523bd4c130ce848891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 8 Sep 2021 01:39:35 +0300 Subject: [PATCH 7/8] Temporary solution --- package-lock.json | 48 +++++++++++++++--------------- src/client/commands/maintenance.js | 3 +- src/client/events/ready.js | 3 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51b35c3..6dc8e6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -221,9 +221,9 @@ } }, "node_modules/@discordjs/node-pre-gyp/node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "engines": { "node": "4.x || >=6.0.0" } @@ -260,9 +260,9 @@ } }, "node_modules/@discordjs/rest/node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "engines": { "node": "4.x || >=6.0.0" } @@ -1352,9 +1352,9 @@ } }, "node_modules/discord.js/node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "engines": { "node": "4.x || >=6.0.0" } @@ -3845,9 +3845,9 @@ } }, "node_modules/web-streams-polyfill": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.0.tgz", - "integrity": "sha512-wO9r1YnYe7kFBLHyyVEhV1H8VRWoNiNnuP+v/HUUmSTaRF8F93Kmd3JMrETx0f11GXxRek6OcL2QtjFIdc5WYw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", + "integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==", "engines": { "node": ">= 8" } @@ -4130,9 +4130,9 @@ }, "dependencies": { "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" } } }, @@ -4161,9 +4161,9 @@ }, "dependencies": { "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" } } }, @@ -4950,9 +4950,9 @@ } }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" } } }, @@ -6811,9 +6811,9 @@ "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=" }, "web-streams-polyfill": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.0.tgz", - "integrity": "sha512-wO9r1YnYe7kFBLHyyVEhV1H8VRWoNiNnuP+v/HUUmSTaRF8F93Kmd3JMrETx0f11GXxRek6OcL2QtjFIdc5WYw==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", + "integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==" }, "which": { "version": "2.0.2", diff --git a/src/client/commands/maintenance.js b/src/client/commands/maintenance.js index 86f23e9..c39f999 100644 --- a/src/client/commands/maintenance.js +++ b/src/client/commands/maintenance.js @@ -1,5 +1,6 @@ import Discord from "discord.js"; -import fetch from "node-fetch"; +const _importDynamic = new Function('modulePath', 'return import(modulePath)'); +const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args)); module.exports = { name: 'maintenance', diff --git a/src/client/events/ready.js b/src/client/events/ready.js index b712155..131ab27 100644 --- a/src/client/events/ready.js +++ b/src/client/events/ready.js @@ -1,5 +1,6 @@ import Datastore from "../datastore.js"; -const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); +const _importDynamic = new Function('modulePath', 'return import(modulePath)'); +const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args)); module.exports = { name: 'ready', From 65bebb7b13f9ca0a4bf9bf287231f115d8dd51a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 9 Sep 2021 12:56:34 +0300 Subject: [PATCH 8/8] Bumb version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6dc8e6e..c1627ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eximiabots-radiox", - "version": "0.3.10", + "version": "0.3.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eximiabots-radiox", - "version": "0.3.10", + "version": "0.3.8", "license": "MIT", "dependencies": { "@discordjs/builders": "^0.6.0", diff --git a/package.json b/package.json index dade298..283b9d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eximiabots-radiox", - "version": "0.3.10", + "version": "0.3.8", "description": "Internet Radio to your Discord guild", "main": "index.js", "scripts": {