Revert "Revert "Now commands is global""

This reverts commit c8659ac884.
This commit is contained in:
unknowableshade committed 2021-11-21 23:46:38 +03:00
1 parent c8659ac884
commit fc691899f2
23 files changed
+210 -254

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@
<TypeScriptCompile Include="src\events\voiceStateUpdate.ts"> <TypeScriptCompile Include="src\events\voiceStateUpdate.ts">
<SubType>Code</SubType> <SubType>Code</SubType>
</TypeScriptCompile> </TypeScriptCompile>
<TypeScriptCompile Include="src\types\Client.ts" /> <TypeScriptCompile Include="src\types\MyClient.ts" />
<TypeScriptCompile Include="src\types\Types.ts" /> <TypeScriptCompile Include="src\types\Types.ts" />
<TypeScriptCompile Include="src\types\Misc.ts" /> <TypeScriptCompile Include="src\types\Misc.ts" />
<TypeScriptCompile Include="src\types\Music.ts" /> <TypeScriptCompile Include="src\types\Music.ts" />
+76 -163
View File
@@ -8,9 +8,9 @@
"name": "5a0a-bot", "name": "5a0a-bot",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.6.0", "@discordjs/opus": "0.7.0",
"@discordjs/voice": "0.6.0", "@discordjs/voice": "0.7.5",
"@types/node": "^14.14.7", "@types/node": "^16.11.9",
"discord-ytdl-core": "5.0.4", "discord-ytdl-core": "5.0.4",
"discord.js": "13.2.0", "discord.js": "13.2.0",
"libsodium-wrappers": "^0.7.9", "libsodium-wrappers": "^0.7.9",
@@ -19,39 +19,12 @@
"ytdl-core": "4.9.1" "ytdl-core": "4.9.1"
}, },
"devDependencies": { "devDependencies": {
"@discordjs/builders": "0.8.2",
"@types/yt-search": "^2.3.2" "@types/yt-search": "^2.3.2"
}, },
"engines": { "engines": {
"node": "16.x.x" "node": "16.x.x"
} }
}, },
"node_modules/@discordjs/builders": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.8.2.tgz",
"integrity": "sha512-/YRd11SrcluqXkKppq/FAVzLIPRVlIVmc6X8ZklspzMIHDtJ+A4W37D43SHvLdH//+NnK+SHW/WeOF4Ts54PeQ==",
"dev": true,
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"discord-api-types": "^0.24.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz",
"integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/collection": { "node_modules/@discordjs/collection": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
@@ -74,50 +47,52 @@
} }
}, },
"node_modules/@discordjs/node-pre-gyp": { "node_modules/@discordjs/node-pre-gyp": {
"version": "0.4.1", "version": "0.4.2",
"resolved": "https://registry.npmjs.org/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.2.tgz",
"integrity": "sha512-PLYLPG3R+m9QlMROOjdy2htQq54g6f9vRb1xPfZ97CL53yj0uNTfpB/jtY/AXY6OKNtZtrre5SKjei8Hcc44HQ==", "integrity": "sha512-V239Czn+DXFGLhhuccwEDBoTdgMGrRu30dOlzm1GzrSIjwFj01ZJerNX7x+CEX1NG1Q/1gGfOOkeZFNHjycrRA==",
"dependencies": { "dependencies": {
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
"make-dir": "^3.1.0", "make-dir": "^3.1.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.5",
"nopt": "^5.0.0", "nopt": "^5.0.0",
"npmlog": "^5.0.0", "npmlog": "^5.0.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"semver": "^7.3.5", "semver": "^7.3.5",
"tar": "^6.1.8" "tar": "^6.1.11"
}, },
"bin": { "bin": {
"node-pre-gyp": "bin/node-pre-gyp" "node-pre-gyp": "bin/node-pre-gyp"
} }
}, },
"node_modules/@discordjs/opus": { "node_modules/@discordjs/opus": {
"version": "0.6.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.7.0.tgz",
"integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==", "integrity": "sha512-3Xxa3dh7taSDwBAR5fLALZ/KTxvbMmHCMxYLYve6NlPO7Ms1CLmKqp/R4ZoVzkRGQVUVWEhaB1s0v9jfa2tfDg==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@discordjs/node-pre-gyp": "^0.4.1", "@discordjs/node-pre-gyp": "^0.4.2",
"node-addon-api": "^4.0.0" "node-addon-api": "^4.2.0"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"node_modules/@discordjs/voice": { "node_modules/@discordjs/voice": {
"version": "0.6.0", "version": "0.7.5",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.7.5.tgz",
"integrity": "sha512-DF2fZAnB8gX3Qz5BEWPOUl565ptpda1uVmXJije4iK5aQrECfkqc6XcI+wzbGaNvzsH1Wb76NPzxngsEw8bblw==", "integrity": "sha512-lUk+CmIXNKslT6DkC9IF9rpsqhzlTiedauUCPBzepjd4XWxwBZiyVIzR6QpbAirxkAwCoAbbje+3Ho71PGLEAw==",
"dependencies": { "dependencies": {
"@types/ws": "^7.4.4", "@types/ws": "^8.2.0",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.24.0",
"prism-media": "^1.3.1", "prism-media": "^1.3.2",
"tiny-typed-emitter": "^2.0.3", "tiny-typed-emitter": "^2.1.0",
"ws": "^7.4.4" "tslib": "^2.3.1",
"ws": "^8.2.3"
}, },
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=16.0.0",
"npm": ">=7.0.0"
} }
}, },
"node_modules/@sapphire/async-queue": { "node_modules/@sapphire/async-queue": {
@@ -141,14 +116,14 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "14.17.29", "version": "16.11.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.29.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.9.tgz",
"integrity": "sha512-sd4CHI9eTJXTH2vF3RGtGkqvWRwhsSSUFsXD4oG38GZzSZ0tNPbWikd2AbOAcKxCXhOg57fL8FPxjpfSzb2pIQ==" "integrity": "sha512-MKmdASMf3LtPzwLyRrFjtFFZ48cMf8jmX5VRYrDQiJa8Ybu5VAmkqBWqKU8fdCwD8ysw4mQ9nrEHvzg6gunR7A=="
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "7.4.7", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", "integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
@@ -488,9 +463,9 @@
} }
}, },
"node_modules/discord-api-types": { "node_modules/discord-api-types": {
"version": "0.22.0", "version": "0.24.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==", "integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==",
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
@@ -550,14 +525,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/discord.js/node_modules/@types/ws": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/discord.js/node_modules/discord-api-types": { "node_modules/discord.js/node_modules/discord-api-types": {
"version": "0.23.1", "version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
@@ -566,26 +533,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/discord.js/node_modules/ws": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"node_modules/dom-serializer": { "node_modules/dom-serializer": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
@@ -1269,9 +1216,9 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
}, },
"node_modules/signal-exit": { "node_modules/signal-exit": {
"version": "3.0.5", "version": "3.0.6",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
"integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ=="
}, },
"node_modules/string_decoder": { "node_modules/string_decoder": {
"version": "1.3.0", "version": "1.3.0",
@@ -1426,11 +1373,11 @@
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "7.5.5", "version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"engines": { "engines": {
"node": ">=8.3.0" "node": ">=10.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"bufferutil": "^4.0.1", "bufferutil": "^4.0.1",
@@ -1485,27 +1432,6 @@
} }
}, },
"dependencies": { "dependencies": {
"@discordjs/builders": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.8.2.tgz",
"integrity": "sha512-/YRd11SrcluqXkKppq/FAVzLIPRVlIVmc6X8ZklspzMIHDtJ+A4W37D43SHvLdH//+NnK+SHW/WeOF4Ts54PeQ==",
"dev": true,
"requires": {
"@sindresorhus/is": "^4.2.0",
"discord-api-types": "^0.24.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"dependencies": {
"discord-api-types": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz",
"integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A==",
"dev": true
}
}
},
"@discordjs/collection": { "@discordjs/collection": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
@@ -1522,40 +1448,41 @@
} }
}, },
"@discordjs/node-pre-gyp": { "@discordjs/node-pre-gyp": {
"version": "0.4.1", "version": "0.4.2",
"resolved": "https://registry.npmjs.org/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.2.tgz",
"integrity": "sha512-PLYLPG3R+m9QlMROOjdy2htQq54g6f9vRb1xPfZ97CL53yj0uNTfpB/jtY/AXY6OKNtZtrre5SKjei8Hcc44HQ==", "integrity": "sha512-V239Czn+DXFGLhhuccwEDBoTdgMGrRu30dOlzm1GzrSIjwFj01ZJerNX7x+CEX1NG1Q/1gGfOOkeZFNHjycrRA==",
"requires": { "requires": {
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
"make-dir": "^3.1.0", "make-dir": "^3.1.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.5",
"nopt": "^5.0.0", "nopt": "^5.0.0",
"npmlog": "^5.0.0", "npmlog": "^5.0.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"semver": "^7.3.5", "semver": "^7.3.5",
"tar": "^6.1.8" "tar": "^6.1.11"
} }
}, },
"@discordjs/opus": { "@discordjs/opus": {
"version": "0.6.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.7.0.tgz",
"integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==", "integrity": "sha512-3Xxa3dh7taSDwBAR5fLALZ/KTxvbMmHCMxYLYve6NlPO7Ms1CLmKqp/R4ZoVzkRGQVUVWEhaB1s0v9jfa2tfDg==",
"requires": { "requires": {
"@discordjs/node-pre-gyp": "^0.4.1", "@discordjs/node-pre-gyp": "^0.4.2",
"node-addon-api": "^4.0.0" "node-addon-api": "^4.2.0"
} }
}, },
"@discordjs/voice": { "@discordjs/voice": {
"version": "0.6.0", "version": "0.7.5",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.7.5.tgz",
"integrity": "sha512-DF2fZAnB8gX3Qz5BEWPOUl565ptpda1uVmXJije4iK5aQrECfkqc6XcI+wzbGaNvzsH1Wb76NPzxngsEw8bblw==", "integrity": "sha512-lUk+CmIXNKslT6DkC9IF9rpsqhzlTiedauUCPBzepjd4XWxwBZiyVIzR6QpbAirxkAwCoAbbje+3Ho71PGLEAw==",
"requires": { "requires": {
"@types/ws": "^7.4.4", "@types/ws": "^8.2.0",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.24.0",
"prism-media": "^1.3.1", "prism-media": "^1.3.2",
"tiny-typed-emitter": "^2.0.3", "tiny-typed-emitter": "^2.1.0",
"ws": "^7.4.4" "tslib": "^2.3.1",
"ws": "^8.2.3"
} }
}, },
"@sapphire/async-queue": { "@sapphire/async-queue": {
@@ -1569,14 +1496,14 @@
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==" "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
}, },
"@types/node": { "@types/node": {
"version": "14.17.29", "version": "16.11.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.29.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.9.tgz",
"integrity": "sha512-sd4CHI9eTJXTH2vF3RGtGkqvWRwhsSSUFsXD4oG38GZzSZ0tNPbWikd2AbOAcKxCXhOg57fL8FPxjpfSzb2pIQ==" "integrity": "sha512-MKmdASMf3LtPzwLyRrFjtFFZ48cMf8jmX5VRYrDQiJa8Ybu5VAmkqBWqKU8fdCwD8ysw4mQ9nrEHvzg6gunR7A=="
}, },
"@types/ws": { "@types/ws": {
"version": "7.4.7", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", "integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }
@@ -1859,9 +1786,9 @@
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
}, },
"discord-api-types": { "discord-api-types": {
"version": "0.22.0", "version": "0.24.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.24.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==" "integrity": "sha512-X0uA2a92cRjowUEXpLZIHWl4jiX1NsUpDhcEOpa1/hpO1vkaokgZ8kkPtPih9hHth5UVQ3mHBu/PpB4qjyfJ4A=="
}, },
"discord-ytdl-core": { "discord-ytdl-core": {
"version": "5.0.4", "version": "5.0.4",
@@ -1905,24 +1832,10 @@
} }
} }
}, },
"@types/ws": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"requires": {
"@types/node": "*"
}
},
"discord-api-types": { "discord-api-types": {
"version": "0.23.1", "version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==" "integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
},
"ws": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"requires": {}
} }
} }
}, },
@@ -2443,9 +2356,9 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
}, },
"signal-exit": { "signal-exit": {
"version": "3.0.5", "version": "3.0.6",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
"integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ=="
}, },
"string_decoder": { "string_decoder": {
"version": "1.3.0", "version": "1.3.0",
@@ -2572,9 +2485,9 @@
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}, },
"ws": { "ws": {
"version": "7.5.5", "version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"requires": {} "requires": {}
}, },
"yallist": { "yallist": {
+3 -3
View File
@@ -15,9 +15,9 @@
"start": "node dist/app.js" "start": "node dist/app.js"
}, },
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.6.0", "@discordjs/opus": "0.7.0",
"@discordjs/voice": "0.6.0", "@discordjs/voice": "0.7.5",
"@types/node": "^14.14.7", "@types/node": "^16.11.9",
"discord-ytdl-core": "5.0.4", "discord-ytdl-core": "5.0.4",
"discord.js": "13.2.0", "discord.js": "13.2.0",
"libsodium-wrappers": "^0.7.9", "libsodium-wrappers": "^0.7.9",
+2 -2
View File
@@ -1,9 +1,9 @@
"use strict"; "use strict";
import { MyClient } from "./types/Client"; import { MyClient } from "./types/MyClient";
const token = process.env.DISCORD_TOKEN; const token = process.env.DISCORD_TOKEN;
const client = new MyClient("./commands", "./events"); const client = new MyClient("./commands", "./events", "214422162906415106");
client.login(token); client.login(token);
+2 -2
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, Message, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -4,7 +4,7 @@ import {
ColorResolvable, CommandInteraction, GuildMember, ColorResolvable, CommandInteraction, GuildMember,
MessageEmbed, TextChannel MessageEmbed, TextChannel
} from "discord.js"; } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
import { loopOption } from "../../types/Types"; import { loopOption } from "../../types/Types";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
import { run as connect } from "./connect"; import { run as connect } from "./connect";
+1 -1
View File
@@ -6,7 +6,7 @@ import {
MessageButton, MessageComponentInteraction, MessageEmbed MessageButton, MessageComponentInteraction, MessageEmbed
} from "discord.js"; } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
import { generateQueue } from "../../types/Misc"; import { generateQueue } from "../../types/Misc";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,7 +1,7 @@
import { design } from "../../config"; import { design } from "../../config";
import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js"; import { ColorResolvable, CommandInteraction, MessageEmbed } from "discord.js";
import { MyClient } from "../../types/Client"; import { MyClient } from "../../types/MyClient";
+1 -1
View File
@@ -1,5 +1,5 @@
import { Interaction } from "discord.js"; import { Interaction } from "discord.js";
import { MyClient } from "../types/Client"; import { MyClient } from "../types/MyClient";
export async function run(args: Interaction[], client: MyClient): Promise<void> { export async function run(args: Interaction[], client: MyClient): Promise<void> {
const [interaction] = args; const [interaction] = args;
+13 -5
View File
@@ -1,12 +1,20 @@
import { Message } from "discord.js"; import { ClientApplication, Message, User } from "discord.js";
import { MyClient } from "../types/Client"; import { MyClient } from "../types/MyClient";
export async function run(args: Message[], client: MyClient): Promise<void> { export async function run(args: Message[], client: MyClient): Promise<void> {
const [message] = args; const [message] = args;
if (message.guild) const application = client.application as ClientApplication;
await message.guild.commands.set(client.restCommands);
if (application && message.author.id === client.owner) {
switch (message.content) {
case `!${client.user?.username}-dev-set-global-commands`: {
application.commands.set(client.restCommands);
await message.reply("Setting up command interactions. (It can take up to 1 hour)");
break;
}
}
}
} }
export const name = "messageCreate"; export const name = "messageCreate";
+3 -2
View File
@@ -1,9 +1,10 @@
import { MyClient } from "../types/Client"; import { MyClient } from "../types/MyClient";
export async function run(args: unknown[], client: MyClient): Promise<void> { export async function run(args: unknown[], client: MyClient): Promise<void> {
if (!client.user) if (!client.user)
return; return;
console.log(`Logged in as ${client.user.tag}!`);
console.log(`${client.user.username} logged in as ${client.user.tag}!`);
client.user.setActivity("on sound waves.", { type: "PLAYING" }); client.user.setActivity("on sound waves.", { type: "PLAYING" });
} }
+9 -12
View File
@@ -1,6 +1,6 @@
import { ColorResolvable, MessageEmbed, VoiceState } from "discord.js"; import { ColorResolvable, MessageEmbed, VoiceState } from "discord.js";
import { design } from "../config"; import { design } from "../config";
import { MyClient } from "../types/Client"; import { MyClient } from "../types/MyClient";
import { sleep } from "../types/Misc"; import { sleep } from "../types/Misc";
export async function run(args: VoiceState[], client: MyClient): Promise<void> { export async function run(args: VoiceState[], client: MyClient): Promise<void> {
@@ -11,20 +11,17 @@ export async function run(args: VoiceState[], client: MyClient): Promise<void> {
if (!player) if (!player)
return; return;
if (newState.id === client.user?.id && newState.deaf === false) { if (oldState.channel?.members.size === 1 && oldState.channel.members.first()?.id === client.user?.id) {
newState.setDeaf(true); await sleep(30000);
const channel = player.channel;
if (oldState.channel.members.size === 1)
player.destroy();
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setColor(design.color as ColorResolvable) .setColor(design.color as ColorResolvable)
.setTitle("Please do not undeafen me.") .setTitle("I've decided to leave to conserve my energy")
.setDescription("It's for your own privacy, trust me.") .setDescription("Since there was nobody in the voice channel.")
await player.channel.send({ embeds: [embed] }); await channel.send({ embeds: [embed] });
}
if (newState.channel?.members.size === 1 && newState.channel.members.first()) {
await sleep(30000);
if (newState.channel.members.first()?.id === client.user?.id)
player.destroy();
} }
} }
+65 -44
View File
@@ -20,17 +20,35 @@ import yts from "yt-search";
export class Player { export class Player {
public guild: Guild; public guild: Guild;
public music: Music; public music: Music;
public channel: TextChannel;
public connection: VoiceConnection | undefined; private _connection: VoiceConnection | undefined;
public player: AudioPlayer | undefined; get connection(): VoiceConnection | undefined {
return this._connection;
}
private _player: AudioPlayer | undefined;
get player(): AudioPlayer | undefined {
return this._player;
}
public queue: track[] = []; public queue: track[] = [];
public queuePosition: number = 0;
public nowPlaying: AudioResource | undefined;
public filters: filter = {};
public repeatMode: loopOption = "LOOP";
public channel: TextChannel; private _queuePosition: number = 0;
get queuePosition(): number {
return this._queuePosition;
}
private _nowPlaying: AudioResource | undefined;
get nowPlaying(): AudioResource | undefined {
return this._nowPlaying;
}
public filters: filter = {};
public repeatMode: loopOption = "LOOP";
public message: Message | undefined; public message: Message | undefined;
public constructor(playerGuild: Guild, clientMusic: Music, ctxChannel: TextChannel) { public constructor(playerGuild: Guild, clientMusic: Music, ctxChannel: TextChannel) {
@@ -49,28 +67,31 @@ export class Player {
seek: seek seek: seek
}); });
this.nowPlaying = createAudioResource(stream, { this._nowPlaying = createAudioResource(stream, {
inlineVolume: true, inlineVolume: true,
metadata: track metadata: track
}); });
await player.play(this.nowPlaying); await player.play(this._nowPlaying);
return player; return player;
} }
private _resourceEndResolvable(): boolean { private _resourceEndResolvable(): boolean {
if (this._nowPlaying)
this._nowPlaying.encoder?.destroy();
switch (this.repeatMode) { switch (this.repeatMode) {
case "NONE": { case "NONE": {
if (++this.queuePosition >= this.queue.length) { if (++this._queuePosition >= this.queue.length) {
this.queuePosition = 0; this._queuePosition = 0;
this.nowPlaying = undefined; this._nowPlaying = undefined;
return false; return false;
} }
return true; return true;
} }
case "LOOP": { case "LOOP": {
this.queuePosition = (this.queuePosition + 1) % this.queue.length; this._queuePosition = (this._queuePosition + 1) % this.queue.length;
return true; return true;
} }
case "SONG": return true; case "SONG": return true;
@@ -107,15 +128,15 @@ export class Player {
} }
public async play(seek: number = 0): Promise<void> { public async play(seek: number = 0): Promise<void> {
if (!this.connection || this.queue.length === 0) if (!this._connection || this.queue.length === 0)
return; return;
const track = this.queue[this.queuePosition]; const track = this.queue[this._queuePosition];
this.player = await this._playerCreator(track, seek); this._player = await this._playerCreator(track, seek);
this.connection.subscribe(this.player); this._connection.subscribe(this._player);
this.player.on(AudioPlayerStatus.Idle, async () => { this._player.on(AudioPlayerStatus.Idle, async () => {
if (this._resourceEndResolvable()) if (this._resourceEndResolvable())
await this.play(); await this.play();
}); });
@@ -124,18 +145,18 @@ export class Player {
} }
public connect(channel: VoiceChannel | StageChannel): void { public connect(channel: VoiceChannel | StageChannel): void {
this.connection = joinVoiceChannel({ this._connection = joinVoiceChannel({
channelId: channel.id, channelId: channel.id,
guildId: channel.guildId, guildId: channel.guildId,
selfDeaf: true, // selfDeaf: true,
adapterCreator: channel.guild.voiceAdapterCreator as unknown as DiscordGatewayAdapterCreator adapterCreator: channel.guild.voiceAdapterCreator as unknown as DiscordGatewayAdapterCreator
}); });
this.connection.on(VoiceConnectionStatus.Disconnected, async (oldState, newState) => { this._connection.on(VoiceConnectionStatus.Disconnected, async (oldState, newState) => {
try { try {
await Promise.race([ await Promise.race([
entersState(this.connection as VoiceConnection, VoiceConnectionStatus.Signalling, 5_000), entersState(this._connection as VoiceConnection, VoiceConnectionStatus.Signalling, 5_000),
entersState(this.connection as VoiceConnection, VoiceConnectionStatus.Connecting, 5_000), entersState(this._connection as VoiceConnection, VoiceConnectionStatus.Connecting, 5_000),
]); ]);
} }
catch (error) { catch (error) {
@@ -159,8 +180,8 @@ export class Player {
this.queue.push(metadata); this.queue.push(metadata);
else { else {
this.queue.splice(Math.max(0, index), 0, metadata) this.queue.splice(Math.max(0, index), 0, metadata)
if (this.queuePosition >= index) if (this._queuePosition >= index)
this.queuePosition++; this._queuePosition++;
} }
return metadata; return metadata;
@@ -168,24 +189,24 @@ export class Player {
public clear() { public clear() {
this.queue = []; this.queue = [];
this.queuePosition = 0; this._queuePosition = 0;
this.nowPlaying = undefined; this._nowPlaying = undefined;
if (this.player) if (this._player)
this.player.stop(); this._player.stop();
} }
public destroy() { public destroy() {
if (this.connection) if (this._connection)
this.connection.destroy(); this._connection.destroy();
this.music.delPlayer(this.guild.id); this.music.delPlayer(this.guild.id);
} }
public async jump(query: number | string): Promise<boolean> { public async jump(query: number | string): Promise<boolean> {
if (!this.player) if (!this._player)
return false; return false;
if (typeof query === "number" && query < this.queue.length && query >= 0) { if (typeof query === "number" && query < this.queue.length && query >= 0) {
this.queuePosition = query; this._queuePosition = query;
await this.play(); await this.play();
return true; return true;
} }
@@ -193,7 +214,7 @@ export class Player {
for (let i = 0; i < this.queue.length; i++) { for (let i = 0; i < this.queue.length; i++) {
const track = this.queue[i]; const track = this.queue[i];
if (track.title.toLowerCase().includes(String(query).toLowerCase())) { if (track.title.toLowerCase().includes(String(query).toLowerCase())) {
this.queuePosition = i; this._queuePosition = i;
await this.play(); await this.play();
return true; return true;
} }
@@ -205,7 +226,7 @@ export class Player {
public async remove(query: number | string): Promise<boolean> { public async remove(query: number | string): Promise<boolean> {
if (typeof query === "number" && query < this.queue.length && query >= 0) { if (typeof query === "number" && query < this.queue.length && query >= 0) {
this.queue.splice(query, 1); this.queue.splice(query, 1);
if (query === this.queuePosition) if (query === this._queuePosition)
await this.play(); await this.play();
return true; return true;
} }
@@ -214,7 +235,7 @@ export class Player {
const track = this.queue[i]; const track = this.queue[i];
if (track.title.toLowerCase().includes(String(query).toLowerCase())) { if (track.title.toLowerCase().includes(String(query).toLowerCase())) {
this.queue.splice(i, 1); this.queue.splice(i, 1);
if (i === this.queuePosition) if (i === this._queuePosition)
await this.play(); await this.play();
return true; return true;
} }
@@ -228,15 +249,15 @@ export class Player {
} }
public pause(): boolean { public pause(): boolean {
if (!this.player) if (!this._player)
return false; return false;
if (this.player.state.status === AudioPlayerStatus.Paused) { if (this._player.state.status === AudioPlayerStatus.Paused) {
this.player.unpause(); this._player.unpause();
return false; return false;
} }
else { else {
this.player.pause(); this._player.pause();
return true; return true;
} }
} }
@@ -246,8 +267,8 @@ export class Player {
} }
public volume(amount: number): boolean { public volume(amount: number): boolean {
if (amount > 0 && amount < Infinity && this.nowPlaying && this.nowPlaying.volume) { if (amount > 0 && amount < Infinity && this._nowPlaying && this._nowPlaying.volume) {
this.nowPlaying.volume.setVolumeLogarithmic(amount / 100); this._nowPlaying.volume.setVolumeLogarithmic(amount / 100);
return true; return true;
} }
return false; return false;
@@ -258,8 +279,8 @@ export class Player {
} }
public skip(): void { public skip(): void {
if (this.player) if (this._player)
this.player.stop(); this._player.stop();
} }
} }
+22 -7
View File
@@ -1,15 +1,28 @@
import { ApplicationCommandData, Client as DiscordClient, Intents } from "discord.js"; import { ApplicationCommandData, Client as DiscordClient, Intents, User } from "discord.js";
import { readdirSync } from "fs"; import { readdirSync } from "fs";
import { Music } from "./Music"; import { Music } from "./Music";
export class MyClient extends DiscordClient { export class MyClient extends DiscordClient {
commands = new Map<string, any>(); private _commands = new Map<string, any>();
restCommands: ApplicationCommandData[] = []; private _restCommands: ApplicationCommandData[] = [];
players = new Music(); private _owner: string;
public players = new Music();
get commands(): Map<string, any> {
return this._commands;
}
get restCommands(): ApplicationCommandData[] {
return this._restCommands;
}
get owner(): string {
return this._owner;
}
constructor(commandsPath: string, eventsPath: string) { public constructor(commandsPath: string, eventsPath: string, ownerId: string) {
super({ super({
intents: [ intents: [
Intents.FLAGS.GUILDS, Intents.FLAGS.GUILDS,
@@ -24,8 +37,8 @@ export class MyClient extends DiscordClient {
for (const file of cmdFiles) { for (const file of cmdFiles) {
import(`.${commandsPath}/${dir}/${file}`).then((command) => { import(`.${commandsPath}/${dir}/${file}`).then((command) => {
const name = command.data.name; const name = command.data.name;
this.restCommands.push(command.data); this._restCommands.push(command.data);
this.commands.set(name, command); this._commands.set(name, command);
}); });
} }
}); });
@@ -39,5 +52,7 @@ export class MyClient extends DiscordClient {
}); });
}); });
} }
this._owner = ownerId;
} }
} }
+2 -1
View File
@@ -7,7 +7,8 @@
"esModuleInterop": true, "esModuleInterop": true,
"moduleResolution": "Node", "moduleResolution": "Node",
"lib": [ "ESNext", "DOM" ], "lib": [ "ESNext", "DOM" ],
"sourceMap": true "sourceMap": true,
"types": [ "node" ]
}, },
"include": [ "include": [
"src/**/*" "src/**/*"