diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c2b177..93aa29f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ ## βš™οΈ Bug Fixes -1. Fork the repo and create your branch from `main`. +1. Fork the repo and create your branch from `dev`. 2. First, install the dependencies with `pnpm install`. 3. Make your code change. 4. Try to be clear and concise as possible. diff --git a/INSTALLATION.md b/INSTALLATION.md index 47c384a..3fd141b 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -19,7 +19,7 @@ pnpm i ### πŸ“‹ Configuration * Stelle has a configuration to save a specific data. -> 1. Go to [the configuration](/src/structures/utils/data/Configuration.ts#L16-L19) +> 1. Go to [the configuration](/src/structures/utils/data/Configuration.ts#L17-L20) > 2. Replace the IDs with your IDs. > Example: diff --git a/LAVALINK.md b/LAVALINK.md index 91dd932..e924d64 100644 --- a/LAVALINK.md +++ b/LAVALINK.md @@ -29,4 +29,4 @@ You can use my example: *Or `sh start.sh` if you are on a ubuntu server* ### πŸ“‹ Using the node -* Just, go to the [configuration](/src/structures/utils/data/Configuration.ts#L20) of Stelle and add the node to the list. \ No newline at end of file +* Just, go to the [configuration](/src/structures/utils/data/Configuration.ts#L21) of Stelle and add the node to the list. \ No newline at end of file diff --git a/package.json b/package.json index 5aa17bd..c7051e4 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "stelle-music", - "version": "0.2.7-BLAZER", + "version": "0.2.8-BLAZER", "description": "A music bot.", "main": "./dist/index.js", "type": "module", - "packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e", + "packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf", "homepage": "https://github.com/Ganyu-Studios/stelle-music#readme", "scripts": { "test": "pnpm clean && pnpm start:debug", @@ -32,7 +32,7 @@ "url": "https://github.com/Ganyu-Studios/stelle-music/issues" }, "dependencies": { - "@prisma/client": "^5.17.0", + "@prisma/client": "^5.18.0", "chalk": "^5.3.0", "dotenv": "^16.4.5", "humanize-duration": "^3.32.1", @@ -45,10 +45,10 @@ "@biomejs/biome": "^1.8.3", "@types/humanize-duration": "^3.27.4", "@types/ms": "^0.7.34", - "@types/node": "^20.14.12", - "husky": "^9.1.3", - "lint-staged": "^15.2.7", - "prisma": "^5.17.0", + "@types/node": "^22.2.0", + "husky": "^9.1.4", + "lint-staged": "^15.2.9", + "prisma": "^5.18.0", "typescript": "^5.5.4" }, "imports": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0fe2ee0..78ba8da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@prisma/client': - specifier: ^5.17.0 - version: 5.17.0(prisma@5.17.0) + specifier: ^5.18.0 + version: 5.18.0(prisma@5.18.0) chalk: specifier: ^5.3.0 version: 5.3.0 @@ -22,16 +22,16 @@ importers: version: 3.32.1 lavalink-client: specifier: github:Tomato6966/lavalink-client - version: https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/0b99fd660be8662fde7d35228068287d0e007d1a + version: https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/d6d361be64cb6d8a19d29fb602a1888c09e33572 ms: specifier: ^2.1.3 version: 2.1.3 seyfert: specifier: github:tiramisulabs/seyfert - version: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/2f1ba85a94ba99f6974eab490df73d5dc825e82a + version: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/9066f510e366b9a570457c47a2d8d95cf840d3c9 yunaforseyfert: specifier: github:SagiriIkeda/yunaforseyfert#dev - version: https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/1eef92caa7bdf3b357febde3295b674df5f23ea5 + version: https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/19f1ae90fa9d16b8ad8fdd1f8c5eb56b49168cad devDependencies: '@biomejs/biome': specifier: ^1.8.3 @@ -43,17 +43,17 @@ importers: specifier: ^0.7.34 version: 0.7.34 '@types/node': - specifier: ^20.14.12 - version: 20.14.12 + specifier: ^22.2.0 + version: 22.2.0 husky: - specifier: ^9.1.3 - version: 9.1.3 + specifier: ^9.1.4 + version: 9.1.4 lint-staged: - specifier: ^15.2.7 - version: 15.2.7 + specifier: ^15.2.9 + version: 15.2.9 prisma: - specifier: ^5.17.0 - version: 5.17.0 + specifier: ^5.18.0 + version: 5.18.0 typescript: specifier: ^5.5.4 version: 5.5.4 @@ -116,8 +116,8 @@ packages: '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} - '@prisma/client@5.17.0': - resolution: {integrity: sha512-N2tnyKayT0Zf7mHjwEyE8iG7FwTmXDHFZ1GnNhQp0pJUObsuel4ZZ1XwfuAYkq5mRIiC/Kot0kt0tGCfLJ70Jw==} + '@prisma/client@5.18.0': + resolution: {integrity: sha512-BWivkLh+af1kqC89zCJYkHsRcyWsM8/JHpsDMM76DjP3ZdEquJhXa4IeX+HkWPnwJ5FanxEJFZZDTWiDs/Kvyw==} engines: {node: '>=16.13'} peerDependencies: prisma: '*' @@ -125,20 +125,20 @@ packages: prisma: optional: true - '@prisma/debug@5.17.0': - resolution: {integrity: sha512-l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GTxm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg==} + '@prisma/debug@5.18.0': + resolution: {integrity: sha512-f+ZvpTLidSo3LMJxQPVgAxdAjzv5OpzAo/eF8qZqbwvgi2F5cTOI9XCpdRzJYA0iGfajjwjOKKrVq64vkxEfUw==} - '@prisma/engines-version@5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053': - resolution: {integrity: sha512-tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg==} + '@prisma/engines-version@5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169': + resolution: {integrity: sha512-a/+LpJj8vYU3nmtkg+N3X51ddbt35yYrRe8wqHTJtYQt7l1f8kjIBcCs6sHJvodW/EK5XGvboOiwm47fmNrbgg==} - '@prisma/engines@5.17.0': - resolution: {integrity: sha512-+r+Nf+JP210Jur+/X8SIPLtz+uW9YA4QO5IXA+KcSOBe/shT47bCcRMTYCbOESw3FFYFTwe7vU6KTWHKPiwvtg==} + '@prisma/engines@5.18.0': + resolution: {integrity: sha512-ofmpGLeJ2q2P0wa/XaEgTnX/IsLnvSp/gZts0zjgLNdBhfuj2lowOOPmDcfKljLQUXMvAek3lw5T01kHmCG8rg==} - '@prisma/fetch-engine@5.17.0': - resolution: {integrity: sha512-ESxiOaHuC488ilLPnrv/tM2KrPhQB5TRris/IeIV4ZvUuKeaicCl4Xj/JCQeG9IlxqOgf1cCg5h5vAzlewN91Q==} + '@prisma/fetch-engine@5.18.0': + resolution: {integrity: sha512-I/3u0x2n31rGaAuBRx2YK4eB7R/1zCuayo2DGwSpGyrJWsZesrV7QVw7ND0/Suxeo/vLkJ5OwuBqHoCxvTHpOg==} - '@prisma/get-platform@5.17.0': - resolution: {integrity: sha512-UlDgbRozCP1rfJ5Tlkf3Cnftb6srGrEQ4Nm3og+1Se2gWmCZ0hmPIi+tQikGDUVLlvOWx3Gyi9LzgRP+HTXV9w==} + '@prisma/get-platform@5.18.0': + resolution: {integrity: sha512-Tk+m7+uhqcKDgnMnFN0lRiH7Ewea0OEsZZs9pqXa7i3+7svS3FSCqDBCaM9x5fmhhkufiG0BtunJVDka+46DlA==} '@types/humanize-duration@3.27.4': resolution: {integrity: sha512-yaf7kan2Sq0goxpbcwTQ+8E9RP6HutFBPv74T/IA/ojcHKhuKVlk2YFYyHhWZeLvZPzzLE3aatuQB4h0iqyyUA==} @@ -146,8 +146,8 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@20.14.12': - resolution: {integrity: sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==} + '@types/node@22.2.0': + resolution: {integrity: sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==} ansi-escapes@7.0.0: resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} @@ -263,8 +263,8 @@ packages: humanize-duration@3.32.1: resolution: {integrity: sha512-inh5wue5XdfObhu/IGEMiA1nUXigSGcaKNemcbLRKa7jXYGDZXr3LoT9pTIzq2hPEbld7w/qv9h+ikWGz8fL1g==} - husky@9.1.3: - resolution: {integrity: sha512-ET3TQmQgdIu0pt+jKkpo5oGyg/4MQZpG6xcam5J5JyNJV+CBT23OBpCF15bKHKycRyMH9k6ONy8g2HdGIsSkMQ==} + husky@9.1.4: + resolution: {integrity: sha512-bho94YyReb4JV7LYWRWxZ/xr6TtOTt8cMfmQ39MQYJ7f/YE268s3GdghGwi+y4zAeqewE5zYLvuhV0M0ijsDEA==} engines: {node: '>=18'} hasBin: true @@ -303,17 +303,17 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - lavalink-client@https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/0b99fd660be8662fde7d35228068287d0e007d1a: - resolution: {tarball: https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/0b99fd660be8662fde7d35228068287d0e007d1a} - version: 2.2.1 + lavalink-client@https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/d6d361be64cb6d8a19d29fb602a1888c09e33572: + resolution: {tarball: https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/d6d361be64cb6d8a19d29fb602a1888c09e33572} + version: 2.2.2 engines: {node: '>=18.0.0'} lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} - lint-staged@15.2.7: - resolution: {integrity: sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==} + lint-staged@15.2.9: + resolution: {integrity: sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==} engines: {node: '>=18.12.0'} hasBin: true @@ -388,8 +388,8 @@ packages: engines: {node: '>=0.10'} hasBin: true - prisma@5.17.0: - resolution: {integrity: sha512-m4UWkN5lBE6yevqeOxEvmepnL5cNPEjzMw2IqDB59AcEV6w7D8vGljDLd1gPFH+W6gUxw9x7/RmN5dCS/WTPxA==} + prisma@5.18.0: + resolution: {integrity: sha512-+TrSIxZsh64OPOmaSgVPH7ALL9dfU0jceYaMJXsNrTkFHO7/3RANi5K2ZiPB1De9+KDxCWn7jvRq8y8pvk+o9g==} engines: {node: '>=16.13'} hasBin: true @@ -412,8 +412,8 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - seyfert@https://codeload.github.com/tiramisulabs/seyfert/tar.gz/2f1ba85a94ba99f6974eab490df73d5dc825e82a: - resolution: {tarball: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/2f1ba85a94ba99f6974eab490df73d5dc825e82a} + seyfert@https://codeload.github.com/tiramisulabs/seyfert/tar.gz/9066f510e366b9a570457c47a2d8d95cf840d3c9: + resolution: {tarball: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/9066f510e366b9a570457c47a2d8d95cf840d3c9} version: 1.5.0 shebang-command@2.0.0: @@ -474,8 +474,8 @@ packages: resolution: {tarball: https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7} version: 20.42.0 - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.13.0: + resolution: {integrity: sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==} which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} @@ -498,13 +498,13 @@ packages: utf-8-validate: optional: true - yaml@2.4.5: - resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + yaml@2.5.0: + resolution: {integrity: sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==} engines: {node: '>= 14'} hasBin: true - yunaforseyfert@https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/1eef92caa7bdf3b357febde3295b674df5f23ea5: - resolution: {tarball: https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/1eef92caa7bdf3b357febde3295b674df5f23ea5} + yunaforseyfert@https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/19f1ae90fa9d16b8ad8fdd1f8c5eb56b49168cad: + resolution: {tarball: https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/19f1ae90fa9d16b8ad8fdd1f8c5eb56b49168cad} version: 1.0.0 snapshots: @@ -547,38 +547,38 @@ snapshots: '@ioredis/commands@1.2.0': optional: true - '@prisma/client@5.17.0(prisma@5.17.0)': + '@prisma/client@5.18.0(prisma@5.18.0)': optionalDependencies: - prisma: 5.17.0 + prisma: 5.18.0 - '@prisma/debug@5.17.0': {} + '@prisma/debug@5.18.0': {} - '@prisma/engines-version@5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053': {} + '@prisma/engines-version@5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169': {} - '@prisma/engines@5.17.0': + '@prisma/engines@5.18.0': dependencies: - '@prisma/debug': 5.17.0 - '@prisma/engines-version': 5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053 - '@prisma/fetch-engine': 5.17.0 - '@prisma/get-platform': 5.17.0 + '@prisma/debug': 5.18.0 + '@prisma/engines-version': 5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169 + '@prisma/fetch-engine': 5.18.0 + '@prisma/get-platform': 5.18.0 - '@prisma/fetch-engine@5.17.0': + '@prisma/fetch-engine@5.18.0': dependencies: - '@prisma/debug': 5.17.0 - '@prisma/engines-version': 5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053 - '@prisma/get-platform': 5.17.0 + '@prisma/debug': 5.18.0 + '@prisma/engines-version': 5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169 + '@prisma/get-platform': 5.18.0 - '@prisma/get-platform@5.17.0': + '@prisma/get-platform@5.18.0': dependencies: - '@prisma/debug': 5.17.0 + '@prisma/debug': 5.18.0 '@types/humanize-duration@3.27.4': {} '@types/ms@0.7.34': {} - '@types/node@20.14.12': + '@types/node@22.2.0': dependencies: - undici-types: 5.26.5 + undici-types: 6.13.0 ansi-escapes@7.0.0: dependencies: @@ -685,7 +685,7 @@ snapshots: humanize-duration@3.32.1: {} - husky@9.1.3: {} + husky@9.1.4: {} ioredis@5.4.1: dependencies: @@ -727,7 +727,7 @@ snapshots: isexe@2.0.0: {} - lavalink-client@https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/0b99fd660be8662fde7d35228068287d0e007d1a: + lavalink-client@https://codeload.github.com/Tomato6966/lavalink-client/tar.gz/d6d361be64cb6d8a19d29fb602a1888c09e33572: dependencies: tslib: 2.6.3 ws: 8.18.0 @@ -737,7 +737,7 @@ snapshots: lilconfig@3.1.2: {} - lint-staged@15.2.7: + lint-staged@15.2.9: dependencies: chalk: 5.3.0 commander: 12.1.0 @@ -748,7 +748,7 @@ snapshots: micromatch: 4.0.7 pidtree: 0.6.0 string-argv: 0.3.2 - yaml: 2.4.5 + yaml: 2.5.0 transitivePeerDependencies: - supports-color @@ -815,9 +815,9 @@ snapshots: pidtree@0.6.0: {} - prisma@5.17.0: + prisma@5.18.0: dependencies: - '@prisma/engines': 5.17.0 + '@prisma/engines': 5.18.0 readdirp@3.6.0: dependencies: @@ -839,19 +839,16 @@ snapshots: rfdc@1.4.1: {} - seyfert@https://codeload.github.com/tiramisulabs/seyfert/tar.gz/2f1ba85a94ba99f6974eab490df73d5dc825e82a: + seyfert@https://codeload.github.com/tiramisulabs/seyfert/tar.gz/9066f510e366b9a570457c47a2d8d95cf840d3c9: dependencies: magic-bytes.js: 1.10.0 - ws: 8.18.0 optionalDependencies: chokidar: 3.6.0 ioredis: 5.4.1 tweetnacl: 1.0.3 uWebSockets.js: https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7 transitivePeerDependencies: - - bufferutil - supports-color - - utf-8-validate shebang-command@2.0.0: dependencies: @@ -902,7 +899,7 @@ snapshots: uWebSockets.js@https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/f40213ec0a97d0d8721d9d32d92d6eb6ddcd22e7: optional: true - undici-types@5.26.5: {} + undici-types@6.13.0: {} which@2.0.2: dependencies: @@ -916,12 +913,10 @@ snapshots: ws@8.18.0: {} - yaml@2.4.5: {} + yaml@2.5.0: {} - yunaforseyfert@https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/1eef92caa7bdf3b357febde3295b674df5f23ea5: + yunaforseyfert@https://codeload.github.com/SagiriIkeda/yunaforseyfert/tar.gz/19f1ae90fa9d16b8ad8fdd1f8c5eb56b49168cad: dependencies: - seyfert: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/2f1ba85a94ba99f6974eab490df73d5dc825e82a + seyfert: https://codeload.github.com/tiramisulabs/seyfert/tar.gz/9066f510e366b9a570457c47a2d8d95cf840d3c9 transitivePeerDependencies: - - bufferutil - supports-color - - utf-8-validate diff --git a/src/commands/developer/eval.ts b/src/commands/developer/eval.ts index b1f7805..e1386c6 100644 --- a/src/commands/developer/eval.ts +++ b/src/commands/developer/eval.ts @@ -5,7 +5,7 @@ import { StelleOptions } from "#stelle/decorators"; import { Configuration } from "#stelle/data/Configuration.js"; import { codeBlock, getDepth, sliceText } from "#stelle/utils/functions/utils.js"; -import { DeclareParserConfig, Watch, Yuna } from "yunaforseyfert"; +import { DeclareParserConfig, ParserRecommendedConfig, Watch, Yuna } from "yunaforseyfert"; import { SECRETS_MESSAGES, SECRETS_REGEX } from "#stelle/data/Constants.js"; import ms from "ms"; @@ -27,11 +27,7 @@ const options = { }) @Options(options) @StelleOptions({ onlyDeveloper: true }) -@DeclareParserConfig({ - breakSearchOnConsumeAllOptions: true, - disableLongTextTagsInLastOption: true, - useCodeBlockLangAsAnOption: true, -}) +@DeclareParserConfig(ParserRecommendedConfig.Eval) export default class EvalCommand extends Command { @Watch({ idle: ms("1min"), @@ -39,10 +35,18 @@ export default class EvalCommand extends Command { const watcher = Yuna.watchers.find(ctx.client, { userId: ctx.author.id, command: this }); if (!watcher) return; - watcher.stop("Another instance of command created."); + watcher.stop("Another execution"); }, onStop(reason) { - this.ctx?.editOrReply({ content: `Watcher stoped: ${reason}`, embeds: [] }); + this.ctx?.editOrReply({ + content: "", + embeds: [ + { + description: `\`🐐\` Eval command watcher ended by: \`${reason}\``, + color: EmbedColors.White, + }, + ], + }); }, }) async run(ctx: CommandContext): Promise { @@ -78,7 +82,7 @@ export default class EvalCommand extends Command { output = await eval(code); typecode = typeof output; - output = getDepth(output).replaceAll(process.env.TOKEN, client.token); + output = getDepth(output).replaceAll(process.env.TOKEN!, client.token); } await ctx.editOrReply({ diff --git a/src/commands/guild/default/engine.ts b/src/commands/guild/default/engine.ts index ea1cbc0..2d58730 100644 --- a/src/commands/guild/default/engine.ts +++ b/src/commands/guild/default/engine.ts @@ -1,8 +1,6 @@ import type { SearchPlatform } from "lavalink-client"; import { type CommandContext, Declare, LocalesT, Options, SubCommand, createStringOption } from "seyfert"; -import { Shortcut } from "yunaforseyfert"; - const engines: Record = { spsearch: "Spotify", ytsearch: "Youtube", @@ -45,7 +43,6 @@ const options = { }) @Options(options) @LocalesT("locales.default.subcommands.engine.name", "locales.default.subcommands.engine.description") -@Shortcut() export default class EngineSubcommand extends SubCommand { async run(ctx: CommandContext) { const { client, options, guildId } = ctx; diff --git a/src/commands/guild/setlocale.ts b/src/commands/guild/setlocale.ts index 3d02200..19187f0 100644 --- a/src/commands/guild/setlocale.ts +++ b/src/commands/guild/setlocale.ts @@ -15,7 +15,7 @@ const options = { const { client } = interaction; const locales = Object.entries(client.langs!.values).map(([value, l]) => ({ - name: `${l.metadata.name} [${l.metadata.emoji}] - ${l.metadata.traslators.join(", ")}`, + name: `${l.metadata.name} [${l.metadata.emoji}] - ${l.metadata.translators.join(", ")}`, value, })); diff --git a/src/commands/music/autoplay.ts b/src/commands/music/autoplay.ts index b847c77..59564b0 100644 --- a/src/commands/music/autoplay.ts +++ b/src/commands/music/autoplay.ts @@ -23,7 +23,7 @@ export default class AutoplayCommand extends Command { const player = client.manager.getPlayer(guildId); if (!player) return; - player.set("enabledAutoplay", !player.get("enabledAutoplay") ?? true); + player.set("enabledAutoplay", !player.get("enabledAutoplay")); const isAutoplay = player.get("enabledAutoplay"); diff --git a/src/commands/music/move.ts b/src/commands/music/move.ts index 51d2286..a66bc90 100644 --- a/src/commands/music/move.ts +++ b/src/commands/music/move.ts @@ -60,7 +60,7 @@ export default class MoveCommand extends Command { color: client.config.color.success, description: messages.commands.move({ voiceId: voice.id, - textId: text?.toString() ?? ctx.channel()?.toString() ?? "<#1143606303850483280>", + textId: text?.id ?? ctx.channel()?.id ?? "1143606303850483280", }), }, ], diff --git a/src/commands/music/nowplaying.ts b/src/commands/music/nowplaying.ts new file mode 100644 index 0000000..3f40812 --- /dev/null +++ b/src/commands/music/nowplaying.ts @@ -0,0 +1,47 @@ +import { Declare, Command, type CommandContext, type User, LocalesT } from "seyfert"; +import { StelleOptions } from "#stelle/decorators"; + +import { createBar, msParser } from "#stelle/utils/functions/utils.js"; + +@Declare({ + name: "nowplaying", + description: "Get the current playing song.", + integrationTypes: ["GuildInstall"], + contexts: ["Guild"], + aliases: ["np"], +}) +@StelleOptions({ checkNodes: true, checkPlayer: true, cooldown: 5 }) +@LocalesT("locales.nowplaying.name", "locales.nowplaying.description") +export default class NowPlayingCommand extends Command { + async run(ctx: CommandContext) { + const { client, guildId } = ctx; + + if (!guildId) return; + + const { messages } = await ctx.getLocale(); + + const player = client.manager.getPlayer(guildId); + if (!player) return; + + const track = player.queue.current; + if (!track) return; + + await ctx.editOrReply({ + embeds: [ + { + thumbnail: { url: track.info.artworkUrl ?? "" }, + color: client.config.color.success, + description: messages.commands.nowplaying({ + title: track.info.title, + url: track.info.uri, + duration: msParser(track.info.duration), + author: track.info.author, + position: msParser(player.position), + requester: (track.requester as User).id, + bar: createBar(player), + }) + } + ] + }); + } +} diff --git a/src/commands/music/play.ts b/src/commands/music/play.ts index a746a55..386f05a 100644 --- a/src/commands/music/play.ts +++ b/src/commands/music/play.ts @@ -36,7 +36,7 @@ const options = { if (!client.manager.useable) return interaction.respond([{ name: messages.commands.play.autocomplete.noNodes, value: "noNodes" }]); - const voice = member?.voice(); + const voice = client.cache.voiceStates?.get(member!.id, guildId); if (!voice) return interaction.respond([{ name: messages.commands.play.autocomplete.noVoiceChannel, value: "noVoice" }]); const query = interaction.getInput(); @@ -81,10 +81,10 @@ export default class PlayCommand extends Command { if (!(guildId && member)) return; - const voice = await member.voice()?.channel(); + const voice = await client.cache.voiceStates?.get(member!.id, guildId)?.channel(); if (!voice?.is(["GuildVoice", "GuildStageVoice"])) return; - let bot = ctx.me()?.voice(); + let bot = client.cache.voiceStates?.get(client.me.id, guildId); if (bot && bot.channelId !== voice.id) return; const { messages } = await ctx.getLocale(); @@ -102,8 +102,6 @@ export default class PlayCommand extends Command { if (!player.connected) await player.connect(); - await player.node.updateSession(true, client.config.resumeTime); - const { loadType, playlist, tracks } = await player.search({ query, source: searchEngine }, author); player.set("commandContext", ctx); diff --git a/src/commands/music/shuffle.ts b/src/commands/music/shuffle.ts new file mode 100644 index 0000000..eb70552 --- /dev/null +++ b/src/commands/music/shuffle.ts @@ -0,0 +1,32 @@ + +import { Declare, Command, type CommandContext } from "seyfert"; +import { StelleOptions } from "#stelle/decorators"; + +@Declare({ + name: "shuffle", + description: "Shuffle the queue.", + integrationTypes: ["GuildInstall"], + contexts: ["Guild"], + aliases: ["shu", "sh", "shuf"], +}) +@StelleOptions({ checkNodes: true, checkPlayer: true, checkQueue: true, inVoice: true, sameVoice: true, }) +export default class ShuffleCommand extends Command { + async run (ctx: CommandContext) { + const { client } = ctx; + + const player = client.manager.getPlayer(ctx.guildId!); + if (!player) return; + + const { messages } = await ctx.getLocale(); + + await player.queue.shuffle(); + await ctx.editOrReply({ + embeds: [ + { + description: messages.commands.shuffle, + color: client.config.color.success, + }, + ], + }); + } +} diff --git a/src/commands/user/nodes.ts b/src/commands/user/nodes.ts index 4dc9890..82855cd 100644 --- a/src/commands/user/nodes.ts +++ b/src/commands/user/nodes.ts @@ -22,8 +22,8 @@ export default class ExampleCommand extends Command { const pages = new EmbedPaginator(ctx); const maxFields = 25; - const fields = client.manager.nodeManager.nodes.map((node, i) => ({ - name: `\`πŸ”°\` ${node.id} - #${i + 1}`, + const fields = client.manager.nodeManager.nodes.map((node) => ({ + name: `\`πŸ”°\` ${node.id}`, inline: true, value: messages.commands.nodes.value({ state: messages.commands.nodes.states[node.connected ? "connected" : "disconnected"], diff --git a/src/commands/user/ping.ts b/src/commands/user/ping.ts index cdb7e27..7118096 100644 --- a/src/commands/user/ping.ts +++ b/src/commands/user/ping.ts @@ -12,7 +12,7 @@ import { StelleOptions } from "#stelle/decorators"; export default class PingCommand extends Command { async run(ctx: CommandContext): Promise { const { client } = ctx; - const { messages } = ctx.t.get(); + const { messages } = await ctx.getLocale(); const embed = new Embed().setColor(client.config.color.extra).setDescription(messages.commands.ping.message).setTimestamp(); diff --git a/src/components/autoplay.ts b/src/components/autoplay.ts index 0551415..98a7273 100644 --- a/src/components/autoplay.ts +++ b/src/components/autoplay.ts @@ -23,7 +23,7 @@ export default class AutoplayComponent extends ComponentCommand { const player = client.manager.getPlayer(guildId); if (!player) return; - player.set("enabledAutoplay", !player.get("enabledAutoplay") ?? true); + player.set("enabledAutoplay", !player.get("enabledAutoplay")); const isAutoplay = player.get("enabledAutoplay"); @@ -38,7 +38,7 @@ export default class AutoplayComponent extends ComponentCommand { .filter((row) => row.type === ComponentType.Button && row.style !== ButtonStyle.Link) .map((button) => { if ((button as APIButtonComponentWithCustomId).custom_id === "player-toggleAutoplay") - (button as APIButtonComponentWithCustomId).label = messages.events.playerStart.components.autoplay({ + (button as APIButtonComponentWithCustomId).label = messages.events.trackStart.components.autoplay({ type: messages.commands.autoplay.autoplayType[AUTOPLAY_STATE(isAutoplay)], }); diff --git a/src/components/loop.ts b/src/components/loop.ts index 99d26d5..8ed3d2c 100644 --- a/src/components/loop.ts +++ b/src/components/loop.ts @@ -36,7 +36,7 @@ export default class ToggleLoopComponent extends ComponentCommand { .filter((row) => row.type === ComponentType.Button && row.style !== ButtonStyle.Link) .map((button) => { if ((button as APIButtonComponentWithCustomId).custom_id === "player-toggleLoop") - (button as APIButtonComponentWithCustomId).label = messages.events.playerStart.components.loop({ + (button as APIButtonComponentWithCustomId).label = messages.events.trackStart.components.loop({ type: messages.commands.loop.loopType[player.repeatMode], }); diff --git a/src/components/pause.ts b/src/components/pause.ts index 20f7abb..804dc04 100644 --- a/src/components/pause.ts +++ b/src/components/pause.ts @@ -38,7 +38,7 @@ export default class PauseTrackComponent extends ComponentCommand { if ((button as APIButtonComponentWithCustomId).custom_id === "player-pauseTrack") { (button as APIButtonComponentWithCustomId).style = player.paused ? ButtonStyle.Secondary : ButtonStyle.Primary; (button as APIButtonComponentWithCustomId).label = - messages.events.playerStart.components.paused[PAUSE_STATE(player.paused)]; + messages.events.trackStart.components.paused[PAUSE_STATE(player.paused)]; } return new Button(button as APIButtonComponentWithCustomId); diff --git a/src/components/previous.ts b/src/components/previous.ts index 57b5d59..d146999 100644 --- a/src/components/previous.ts +++ b/src/components/previous.ts @@ -21,7 +21,7 @@ export default class PreviousTrackComponent extends ComponentCommand { const player = client.manager.getPlayer(guildId); if (!player) return; - const track = player.queue.previous.shift(); + const track = await player.queue.shiftPrevious(); if (!track) return ctx.editOrReply({ flags: MessageFlags.Ephemeral, diff --git a/src/environment.ts b/src/environment.ts index c0346f5..b96ecca 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -7,14 +7,6 @@ import { customContext } from "#stelle/utils/functions/utils.js"; import defaultLocale from "./locales/en-US.js"; -declare global { - namespace NodeJS { - interface ProcessEnv { - TOKEN: string; - } - } -} - declare module "seyfert" { interface InternalOptions { withPrefix: true; diff --git a/src/lavalink/node/raw.ts b/src/lavalink/node/raw.ts new file mode 100644 index 0000000..a89c8f1 --- /dev/null +++ b/src/lavalink/node/raw.ts @@ -0,0 +1,11 @@ +import { Lavalink } from "#stelle/classes"; +import { DEBUG_MODE } from "#stelle/data/Constants.js"; + +export default new Lavalink({ + name: "raw", + type: "node", + run: (client, _, payload) => { + if (!DEBUG_MODE) return; + return client.debugger?.info({ payload }); + }, +}); \ No newline at end of file diff --git a/src/lavalink/node/resumed.ts b/src/lavalink/node/resumed.ts deleted file mode 100644 index 87a54f3..0000000 --- a/src/lavalink/node/resumed.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Lavalink } from "#stelle/classes"; - -export default new Lavalink({ - name: "resumed", - type: "node", - run: async (client, _node, _payload, players) => { - for await (const player of players) { - const member = await client.members.fetch(player.guildId, client.me.id); - const voice = member.voice(); - if (!voice?.channelId) continue; - - const newPlayer = - client.manager.getPlayer(player.guildId) ?? - client.manager.createPlayer({ - guildId: player.guildId, - volume: player.volume, - voiceChannelId: voice.channelId, - }); - - await newPlayer.queue.utils.sync(); - } - }, -}); diff --git a/src/lavalink/player/start.ts b/src/lavalink/player/start.ts index ba57755..839009f 100644 --- a/src/lavalink/player/start.ts +++ b/src/lavalink/player/start.ts @@ -28,7 +28,7 @@ export default new Lavalink({ const embed = new Embed() .setDescription( - messages.events.playerStart.embed({ + messages.events.trackStart.embed({ duration, requester: (track.requester as User).id, title: track.info.title, @@ -46,19 +46,19 @@ export default new Lavalink({ new Button() .setCustomId("player-stopPlayer") .setStyle(ButtonStyle.Danger) - .setLabel(messages.events.playerStart.components.stop), + .setLabel(messages.events.trackStart.components.stop), new Button() .setCustomId("player-skipTrack") .setStyle(ButtonStyle.Secondary) - .setLabel(messages.events.playerStart.components.skip), + .setLabel(messages.events.trackStart.components.skip), new Button() .setCustomId("player-previousTrack") .setStyle(ButtonStyle.Secondary) - .setLabel(messages.events.playerStart.components.previous), + .setLabel(messages.events.trackStart.components.previous), new Button() .setCustomId("player-guildQueue") .setStyle(ButtonStyle.Primary) - .setLabel(messages.events.playerStart.components.queue), + .setLabel(messages.events.trackStart.components.queue), ); const newRow = new ActionRow