From 8ffa60fb69eb89317e4f22876b4a88cd6c0c16b1 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 18 Jul 2023 20:54:10 -0700 Subject: [PATCH 01/10] Bump ytdl-core --- CHANGELOG.md | 2 ++ package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e7687..fe1b590 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Bumped ytdl-core ## [2.3.0] - 2023-05-13 ### Added diff --git a/package.json b/package.json index acbe61c..397cf7b 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "sync-fetch": "^0.3.1", "tsx": "3.8.2", "xbytes": "^1.7.0", - "ytdl-core": "^4.11.4", + "ytdl-core": "^4.11.5", "ytsr": "^3.8.2" } } diff --git a/yarn.lock b/yarn.lock index 7af8579..15d9354 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4348,10 +4348,10 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -ytdl-core@^4.11.4: - version "4.11.4" - resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.11.4.tgz#0ee2bd04d8effa7b8762a3ba0e3d038e37dc10f2" - integrity sha512-tsVvqt++B5LSTMnCKQb4H/PFBewKj7gGPJ6KIM5gOFGMKNZj4qglGAl4QGFG8cNPP6wY54P80FDID5eN2di0GQ== +ytdl-core@^4.11.5: + version "4.11.5" + resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.11.5.tgz#8cc3dc9e4884e24e8251250cfb56313a300811f0" + integrity sha512-27LwsW4n4nyNviRCO1hmr8Wr5J1wLLMawHCQvH8Fk0hiRqrxuIu028WzbJetiYH28K8XDbeinYW4/wcHQD1EXA== dependencies: m3u8stream "^0.8.6" miniget "^4.2.2" From 2eb2b6d045386d3e0558fbf10b7157b03c7d5f02 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Tue, 18 Jul 2023 20:54:51 -0700 Subject: [PATCH 02/10] Release 2.3.1 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe1b590..6001b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [2.3.1] - 2023-07-18 ### Fixed - Bumped ytdl-core @@ -244,7 +246,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/codetheweb/muse/compare/v2.3.0...HEAD +[unreleased]: https://github.com/codetheweb/muse/compare/v2.3.1...HEAD +[2.3.1]: https://github.com/codetheweb/muse/compare/v2.3.0...v2.3.1 [2.3.0]: https://github.com/codetheweb/muse/compare/v2.2.4...v2.3.0 [2.2.4]: https://github.com/codetheweb/muse/compare/v2.2.3...v2.2.4 [2.2.3]: https://github.com/codetheweb/muse/compare/v2.2.2...v2.2.3 diff --git a/package.json b/package.json index 397cf7b..2f04bfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "2.3.0", + "version": "2.3.1", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "repository": "git@github.com:codetheweb/muse.git", "author": "Max Isom ", From 9c6d2a7acf350ce563d3b4201cd9f18587e222da Mon Sep 17 00:00:00 2001 From: Cory J Reid <11530109+coryjreid@users.noreply.github.com> Date: Wed, 19 Jul 2023 21:28:02 -0600 Subject: [PATCH 03/10] Add pagination to the output of the `favorites list` command (#954) Co-authored-by: Max Isom --- CHANGELOG.md | 8 ++ package.json | 8 +- src/commands/favorites.ts | 30 ++++--- tsconfig.json | 2 +- yarn.lock | 180 +++++++++++++++++++++++++++++++++----- 5 files changed, 192 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6001b44..0b66b58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.0] - 2023-07-19 +### Added +- Pagination to the output of the `favorites list` command + +### Fixed +- Favorites list exceeding Discord's size limit could not be + viewed ([#606](https://github.com/codetheweb/muse/issues/606)) + ## [2.3.1] - 2023-07-18 ### Fixed - Bumped ytdl-core diff --git a/package.json b/package.json index 2f04bfb..5134ace 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/node-emoji": "^1.8.1", "@types/spotify-web-api-node": "^5.0.2", "@types/validator": "^13.1.4", - "@types/ws": "^8.2.2", + "@types/ws": "8.5.4", "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", "eslint": "^7.32.0", @@ -84,7 +84,7 @@ "debug": "^4.3.3", "delay": "^5.0.0", "discord-api-types": "0.32.1", - "discord.js": "14.1.2", + "discord.js": "14.11.0", "dotenv": "^16.0.0", "execa": "^6.1.0", "fluent-ffmpeg": "^2.1.2", @@ -103,6 +103,7 @@ "p-limit": "^4.0.0", "p-queue": "^7.2.0", "p-retry": "4.6.2", + "pagination.djs": "^4.0.10", "parse-duration": "1.0.2", "read-pkg": "7.1.0", "reflect-metadata": "^0.1.13", @@ -113,5 +114,8 @@ "xbytes": "^1.7.0", "ytdl-core": "^4.11.5", "ytsr": "^3.8.2" + }, + "resolutions": { + "@types/ws": "8.5.4" } } diff --git a/src/commands/favorites.ts b/src/commands/favorites.ts index 3cfd716..303dc22 100644 --- a/src/commands/favorites.ts +++ b/src/commands/favorites.ts @@ -1,10 +1,11 @@ import {SlashCommandBuilder} from '@discordjs/builders'; -import {AutocompleteInteraction, ChatInputCommandInteraction, EmbedBuilder} from 'discord.js'; +import {APIEmbedField, AutocompleteInteraction, ChatInputCommandInteraction} from 'discord.js'; import {inject, injectable} from 'inversify'; import Command from '.'; import AddQueryToQueue from '../services/add-query-to-queue.js'; import {TYPES} from '../types.js'; import {prisma} from '../utils/db.js'; +import {Pagination} from 'pagination.djs'; @injectable() export default class implements Command { @@ -54,7 +55,8 @@ export default class implements Command { ), ); - constructor(@inject(TYPES.Services.AddQueryToQueue) private readonly addQueryToQueue: AddQueryToQueue) {} + constructor(@inject(TYPES.Services.AddQueryToQueue) private readonly addQueryToQueue: AddQueryToQueue) { + } requiresVC = (interaction: ChatInputCommandInteraction) => interaction.options.getSubcommand() === 'use'; @@ -135,18 +137,22 @@ export default class implements Command { return; } - const embed = new EmbedBuilder().setTitle('Favorites'); - - let description = ''; - for (const favorite of favorites) { - description += `**${favorite.name}**: ${favorite.query} (<@${favorite.authorId}>)\n`; + const fields = new Array(favorites.length); + for (let index = 0; index < favorites.length; index++) { + const favorite = favorites[index]; + fields[index] = { + inline: false, + name: favorite.name, + value: `${favorite.query} (<@${favorite.authorId}>)`, + }; } - embed.setDescription(description); - - await interaction.reply({ - embeds: [embed], - }); + await new Pagination( + interaction as ChatInputCommandInteraction<'cached'>, + {ephemeral: true, limit: 25}) + .setFields(fields) + .paginateFields(true) + .render(); } private async create(interaction: ChatInputCommandInteraction) { diff --git a/tsconfig.json b/tsconfig.json index f886e86..c02ad2f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "lib": ["esnext"], - "target": "es2018", + "target": "es2020", "module": "ES2020", "moduleResolution": "node", "strict": true, diff --git a/yarn.lock b/yarn.lock index 15d9354..0867c5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,7 +30,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@discordjs/builders@1.1.0", "@discordjs/builders@^1.1.0": +"@discordjs/builders@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.1.0.tgz#4366a4fe069238c3e6e674b74404c79f3ba76525" integrity sha512-EO8TSltiIc9Z1wE854wAFvv5AccqEtvjFmao9PPoxQhRaJ0hEb7FwWRTCA1jGg4ZWI3hcp4m+RET5ufZQz3rOg== @@ -41,11 +41,36 @@ ts-mixer "^6.0.1" tslib "^2.4.0" +"@discordjs/builders@^1.6.3": + version "1.6.3" + resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.6.3.tgz#994b4fe57e77b47096f74bb5a1f664870a930a43" + integrity sha512-CTCh8NqED3iecTNuiz49mwSsrc2iQb4d0MjMdmS/8pb69Y4IlzJ/DIy/p5GFlgOrFbNO2WzMHkWKQSiJ3VNXaw== + dependencies: + "@discordjs/formatters" "^0.3.1" + "@discordjs/util" "^0.3.1" + "@sapphire/shapeshift" "^3.8.2" + discord-api-types "^0.37.41" + fast-deep-equal "^3.1.3" + ts-mixer "^6.0.3" + tslib "^2.5.0" + "@discordjs/collection@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.0.1.tgz#4acc41dfdacd6a14a7cf3109968044a2d40593dd" integrity sha512-5V/wswzR3r2RVYXLxxg4TvrAnBhVCNgHTXhC+OUtLoriJ072rPMHo+Iw1SS1vrCckp8Es40XM411+WkNRPaXFw== +"@discordjs/collection@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.5.1.tgz#bc7ca557838dc29247bf19860426637f103bc383" + integrity sha512-aWEc9DCf3TMDe9iaJoOnO2+JVAjeRNuRxPZQA6GVvBf+Z3gqUuWYBy2NWh4+5CLYq5uoc3MOvUQ5H5m8CJBqOA== + +"@discordjs/formatters@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.1.tgz#81393cf25e6e3223361061629752ea727475e842" + integrity sha512-M7X4IGiSeh4znwcRGcs+49B5tBkNDn4k5bmhxJDAUhRxRHTiFAOTVUNQ6yAKySu5jZTnCbSvTYHW3w0rAzV1MA== + dependencies: + discord-api-types "^0.37.41" + "@discordjs/node-pre-gyp@^0.4.4": version "0.4.4" resolved "https://registry.yarnpkg.com/@discordjs/node-pre-gyp/-/node-pre-gyp-0.4.4.tgz#33eea1038784ffc5715ef775e4f9d6cffaa96c73" @@ -69,7 +94,7 @@ "@discordjs/node-pre-gyp" "^0.4.4" node-addon-api "^5.0.0" -"@discordjs/rest@1.0.1", "@discordjs/rest@^1.0.1": +"@discordjs/rest@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.0.1.tgz#5c1c379de9eb4170b4964a11ced8add1d5ae808d" integrity sha512-w08CTKVzzYYvKxEjXKOs9AdS7KQ1J502TrPfF8eCZ2lF6AfKuMP/32YgDakiwIyYTDjEQS/v0nKLSFcncHRMtg== @@ -82,6 +107,25 @@ tslib "^2.4.0" undici "^5.8.0" +"@discordjs/rest@^1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.7.1.tgz#eeef0e71a37c95fa27962129729b2aa9de8e3752" + integrity sha512-Ofa9UqT0U45G/eX86cURQnX7gzOJLG2oC28VhIk/G6IliYgQF7jFByBJEykPSHE4MxPhqCleYvmsrtfKh1nYmQ== + dependencies: + "@discordjs/collection" "^1.5.1" + "@discordjs/util" "^0.3.0" + "@sapphire/async-queue" "^1.5.0" + "@sapphire/snowflake" "^3.4.2" + discord-api-types "^0.37.41" + file-type "^18.3.0" + tslib "^2.5.0" + undici "^5.22.0" + +"@discordjs/util@^0.3.0", "@discordjs/util@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-0.3.1.tgz#4e8737e1dcff7e9f5eccc3116fb44755b65b1e97" + integrity sha512-HxXKYKg7vohx2/OupUN/4Sd02Ev3PBJ5q0gtjdcvXb0ErCva8jNHWfe/v5sU3UKjIB/uxOhc+TDOnhqffj9pRA== + "@discordjs/voice@0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@discordjs/voice/-/voice-0.11.0.tgz#941f723a969b55cd37f07588d9683914d369be1b" @@ -93,6 +137,21 @@ tslib "^2.4.0" ws "^8.8.1" +"@discordjs/ws@^0.8.3": + version "0.8.3" + resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-0.8.3.tgz#77db8d563b731a2198c1b40f63b1ef8d230504f7" + integrity sha512-hcYtppanjHecbdNyCKQNH2I4RP9UrphDgmRgLYrATEQF1oo4sYSve7ZmGsBEXSzH72MO2tBPdWSThunbxUVk0g== + dependencies: + "@discordjs/collection" "^1.5.1" + "@discordjs/rest" "^1.7.1" + "@discordjs/util" "^0.3.1" + "@sapphire/async-queue" "^1.5.0" + "@types/ws" "^8.5.4" + "@vladfrangu/async_event_emitter" "^2.2.1" + discord-api-types "^0.37.41" + tslib "^2.5.0" + ws "^8.13.0" + "@esbuild-kit/cjs-loader@^2.3.3": version "2.3.3" resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.3.3.tgz#d65a8cc099d88ac58a571403428d82d1a791aefa" @@ -308,6 +367,11 @@ resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.3.2.tgz#befe5f5025e2e317a9eba2d1a24ca5d2e4576f86" integrity sha512-rUpMLATsoAMnlN3gecAcr9Ecnw1vG7zi5Xr+IX22YzRzi1k9PF9vKzoT8RuEJbiIszjcimu3rveqUnvwDopz8g== +"@sapphire/async-queue@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" + integrity sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA== + "@sapphire/shapeshift@^3.5.1": version "3.5.1" resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.5.1.tgz#3bfd0e6bcfdced4ac26a6f450b5f7b8e49f4f2cc" @@ -316,11 +380,24 @@ fast-deep-equal "^3.1.3" lodash.uniqwith "^4.5.0" +"@sapphire/shapeshift@^3.8.2": + version "3.9.2" + resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.2.tgz#a9c12cd51e1bc467619bb56df804450dd14871ac" + integrity sha512-YRbCXWy969oGIdqR/wha62eX8GNHsvyYi0Rfd4rNW6tSVVa8p0ELiMEuOH/k8rgtvRoM+EMV7Csqz77YdwiDpA== + dependencies: + fast-deep-equal "^3.1.3" + lodash "^4.17.21" + "@sapphire/snowflake@^3.2.2": version "3.2.2" resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.2.2.tgz#faacdc1b5f7c43145a71eddba917de2b707ef780" integrity sha512-ula2O0kpSZtX9rKXNeQMrHwNd7E4jPDJYUXmEGTFdMRfyfMw+FPyh04oKMjAiDuOi64bYgVkOV3MjK+loImFhQ== +"@sapphire/snowflake@^3.4.2": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.1.tgz#254521c188b49e8b2d4cc048b475fb2b38737fec" + integrity sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA== + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -472,10 +549,10 @@ resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.7.2.tgz#a2114225d9be743fb154b06c29b8257aaca42922" integrity sha512-KFcchQ3h0OPQgFirBRPZr5F/sVjxZsOrQHedj3zi8AH3Zv/hOLx2OLR4hxR5HcfoU+33n69ZuOfzthKVdMoTiw== -"@types/ws@^8.2.2", "@types/ws@^8.5.3": - version "8.5.3" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" - integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w== +"@types/ws@8.5.4", "@types/ws@^8.5.3", "@types/ws@^8.5.4": + version "8.5.4" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5" + integrity sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg== dependencies: "@types/node" "*" @@ -549,6 +626,11 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" +"@vladfrangu/async_event_emitter@^2.2.1": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz#84c5a3f8d648842cec5cc649b88df599af32ed88" + integrity sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -797,6 +879,13 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -1178,22 +1267,30 @@ discord-api-types@^0.36.2, discord-api-types@^0.36.3: resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.36.3.tgz#a931b7e57473a5c971d6937fa5f392eb30047579" integrity sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg== -discord.js@14.1.2: - version "14.1.2" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.1.2.tgz#6897f9019be3213388950c1cf6d7c9ea4661d42a" - integrity sha512-apdWNLkjAkeEnuNpB8H6rS/4OgrXQlSAjuuzeodjCOdIXy3OwOjD314V/HiSttcAlr9+r3ONhaT5qvbDad5SIg== +discord-api-types@^0.37.41: + version "0.37.48" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.48.tgz#347907bce8f3c00e746b2a7afcf98628d7065731" + integrity sha512-vu2NQJD7SZRjpKDC2DPNsxTz34KS53OrotA+LGRW6mcyT55Hjqu66aRrouzjYhea7tllL9I7rvWVX7bg3aT2AQ== + +discord.js@14.11.0: + version "14.11.0" + resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.11.0.tgz#6529d49f30d10fc5a9ff8e6796661aa998769afe" + integrity sha512-CkueWYFQ28U38YPR8HgsBR/QT35oPpMbEsTNM30Fs8loBIhnA4s70AwQEoy6JvLcpWWJO7GY0y2BUzZmuBMepQ== dependencies: - "@discordjs/builders" "^1.1.0" - "@discordjs/collection" "^1.0.1" - "@discordjs/rest" "^1.0.1" - "@sapphire/snowflake" "^3.2.2" - "@types/ws" "^8.5.3" - discord-api-types "^0.36.3" + "@discordjs/builders" "^1.6.3" + "@discordjs/collection" "^1.5.1" + "@discordjs/formatters" "^0.3.1" + "@discordjs/rest" "^1.7.1" + "@discordjs/util" "^0.3.1" + "@discordjs/ws" "^0.8.3" + "@sapphire/snowflake" "^3.4.2" + "@types/ws" "^8.5.4" + discord-api-types "^0.37.41" fast-deep-equal "^3.1.3" lodash.snakecase "^4.1.1" - tslib "^2.4.0" - undici "^5.8.0" - ws "^8.8.1" + tslib "^2.5.0" + undici "^5.22.0" + ws "^8.13.0" doctrine@^3.0.0: version "3.0.0" @@ -1708,6 +1805,15 @@ file-type@^17.1.4: strtok3 "^7.0.0-alpha.9" token-types "^5.0.0-alpha.2" +file-type@^18.3.0: + version "18.5.0" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-18.5.0.tgz#604a001ba0d32577d4c3fa420ee104d656b914d2" + integrity sha512-yvpl5U868+V6PqXHMmsESpg6unQ5GfnPssl4dxdJudBrr9qy7Fddt7EVX1VLlddFfe8Gj9N7goCZH22FXuSQXQ== + dependencies: + readable-web-to-node-stream "^3.0.2" + strtok3 "^7.0.0" + token-types "^5.0.1" + file-uri-to-path@2: version "2.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz#7b415aeba227d575851e0a5b0c640d7656403fba" @@ -3171,6 +3277,11 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" +pagination.djs@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/pagination.djs/-/pagination.djs-4.0.10.tgz#b487a36de10fd5f89fddea0f9358ae13cfe2cf5e" + integrity sha512-a+ko2x8UdspKHcCkOUZ6IoZ8Ly65tMvrrazl99NOCIjDuy/MpFeBATc4NbH0ywbLlkiJGPnr1HrAW32EW79m8Q== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -3799,6 +3910,11 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -3880,7 +3996,7 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -strtok3@^7.0.0-alpha.9: +strtok3@^7.0.0, strtok3@^7.0.0-alpha.9: version "7.0.0" resolved "https://registry.yarnpkg.com/strtok3/-/strtok3-7.0.0.tgz#868c428b4ade64a8fd8fee7364256001c1a4cbe5" integrity sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ== @@ -3989,7 +4105,7 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -token-types@^5.0.0-alpha.2: +token-types@^5.0.0-alpha.2, token-types@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/token-types/-/token-types-5.0.1.tgz#aa9d9e6b23c420a675e55413b180635b86a093b4" integrity sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg== @@ -4007,6 +4123,11 @@ ts-mixer@^6.0.1: resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.1.tgz#7c2627fb98047eb5f3c7f2fee39d1521d18fe87a" integrity sha512-hvE+ZYXuINrx6Ei6D6hz+PTim0Uf++dYbK9FFifLNwQj+RwKquhQpn868yZsCtJYiclZF1u8l6WZxxKi+vv7Rg== +ts-mixer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.3.tgz#69bd50f406ff39daa369885b16c77a6194c7cae6" + integrity sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ== + tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -4017,6 +4138,11 @@ tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" + integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -4096,6 +4222,13 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici@^5.22.0: + version "5.22.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" + integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== + dependencies: + busboy "^1.6.0" + undici@^5.8.0: version "5.8.1" resolved "https://registry.yarnpkg.com/undici/-/undici-5.8.1.tgz#511d43ff6be02f84ec2513ae7f4b07c589319272" @@ -4298,6 +4431,11 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +ws@^8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + ws@^8.8.1: version "8.8.1" resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" From 6b6066c06a884c374876531eb31852c80fba8822 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Wed, 19 Jul 2023 20:28:22 -0700 Subject: [PATCH 04/10] Release 2.4.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b66b58..e1f484a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.0] - 2023-07-19 + ## [2.4.0] - 2023-07-19 ### Added - Pagination to the output of the `favorites list` command @@ -254,7 +256,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/codetheweb/muse/compare/v2.3.1...HEAD +[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.0...HEAD +[2.4.0]: https://github.com/codetheweb/muse/compare/v2.3.1...v2.4.0 [2.3.1]: https://github.com/codetheweb/muse/compare/v2.3.0...v2.3.1 [2.3.0]: https://github.com/codetheweb/muse/compare/v2.2.4...v2.3.0 [2.2.4]: https://github.com/codetheweb/muse/compare/v2.2.3...v2.2.4 diff --git a/package.json b/package.json index 5134ace..5eb16d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "2.3.1", + "version": "2.4.0", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "repository": "git@github.com:codetheweb/muse.git", "author": "Max Isom ", From 3998b063866f234e370ebd6cf14a85d50c7242ea Mon Sep 17 00:00:00 2001 From: Cory J Reid <11530109+coryjreid@users.noreply.github.com> Date: Sun, 23 Jul 2023 17:06:35 -0600 Subject: [PATCH 05/10] Autocomplete Suggestion Improvements for Favorites Use Command (#956) Co-authored-by: Max Isom --- CHANGELOG.md | 4 +++- src/commands/favorites.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1f484a..0edf82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [2.4.0] - 2023-07-19 +### Fixed +- Autocomplete suggestion search for `favorites use` command is no longer case-sensitive +- Autocomplete suggestion results for `favorites use` could return >25 results which Discord's API does not support ## [2.4.0] - 2023-07-19 ### Added diff --git a/src/commands/favorites.ts b/src/commands/favorites.ts index 303dc22..d43a92c 100644 --- a/src/commands/favorites.ts +++ b/src/commands/favorites.ts @@ -89,14 +89,16 @@ export default class implements Command { }, }); - let results = query === '' ? favorites : favorites.filter(f => f.name.startsWith(query)); + let results = query === '' ? favorites : favorites.filter(f => f.name.toLowerCase().startsWith(query.toLowerCase())); if (subcommand === 'remove') { // Only show favorites that user is allowed to remove results = interaction.member?.user.id === interaction.guild?.ownerId ? results : results.filter(r => r.authorId === interaction.member!.user.id); } - await interaction.respond(results.map(r => ({ + // Limit results to 25 maximum per Discord limits + const trimmed = results.length > 25 ? results.slice(0, 25) : results; + await interaction.respond(trimmed.map(r => ({ name: r.name, value: r.name, }))); From c3ca885392e8d3ce079a967742adae5a6110f5e7 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 23 Jul 2023 16:06:56 -0700 Subject: [PATCH 06/10] Release 2.4.1 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0edf82e..8006a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.1] - 2023-07-23 + ### Fixed - Autocomplete suggestion search for `favorites use` command is no longer case-sensitive - Autocomplete suggestion results for `favorites use` could return >25 results which Discord's API does not support @@ -258,7 +260,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.0...HEAD +[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.1...HEAD +[2.4.1]: https://github.com/codetheweb/muse/compare/v2.4.0...v2.4.1 [2.4.0]: https://github.com/codetheweb/muse/compare/v2.3.1...v2.4.0 [2.3.1]: https://github.com/codetheweb/muse/compare/v2.3.0...v2.3.1 [2.3.0]: https://github.com/codetheweb/muse/compare/v2.2.4...v2.3.0 diff --git a/package.json b/package.json index 5eb16d3..aa5ce7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "2.4.0", + "version": "2.4.1", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "repository": "git@github.com:codetheweb/muse.git", "author": "Max Isom ", From e0988ffc819b1b1057c7030a3b32d381f137e5da Mon Sep 17 00:00:00 2001 From: Eugene Leclerc Date: Sat, 12 Aug 2023 21:07:24 +0200 Subject: [PATCH 07/10] Bump node-ytsr version to 3.8.4 (#959) --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8006a33..01d09dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Bumped node-ytsr ([#948](https://github.com/codetheweb/muse/issues/948)) + ## [2.4.1] - 2023-07-23 ### Fixed diff --git a/package.json b/package.json index aa5ce7f..05278eb 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "tsx": "3.8.2", "xbytes": "^1.7.0", "ytdl-core": "^4.11.5", - "ytsr": "^3.8.2" + "ytsr": "^3.8.4" }, "resolutions": { "@types/ws": "8.5.4" From f1f6ee7e8975f1333f9b39af439be70f34abf5ee Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 12 Aug 2023 12:07:50 -0700 Subject: [PATCH 08/10] Release 2.4.2 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d09dd..62eee10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.2] - 2023-08-12 + ### Fixed - Bumped node-ytsr ([#948](https://github.com/codetheweb/muse/issues/948)) @@ -263,7 +265,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.1...HEAD +[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.2...HEAD +[2.4.2]: https://github.com/codetheweb/muse/compare/v2.4.1...v2.4.2 [2.4.1]: https://github.com/codetheweb/muse/compare/v2.4.0...v2.4.1 [2.4.0]: https://github.com/codetheweb/muse/compare/v2.3.1...v2.4.0 [2.3.1]: https://github.com/codetheweb/muse/compare/v2.3.0...v2.3.1 diff --git a/package.json b/package.json index 05278eb..e22759e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "2.4.1", + "version": "2.4.2", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "repository": "git@github.com:codetheweb/muse.git", "author": "Max Isom ", From dabdf32f76f6090fbab24f10777d3e581c82c5e0 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 10 Sep 2023 16:31:26 -0700 Subject: [PATCH 09/10] Bump ytdl-core Closes https://github.com/codetheweb/muse/issues/970. --- CHANGELOG.md | 4 ++++ Dockerfile | 2 +- package.json | 2 +- yarn.lock | 15 +++++++-------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62eee10..3c31bf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Switched ytdl-core to patched version + ## [2.4.2] - 2023-08-12 ### Fixed diff --git a/Dockerfile b/Dockerfile index 15a4336..6ec862d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM node:18.7.0-slim AS base # Install ffmpeg RUN apt-get update && \ - apt-get install -y ffmpeg tini libssl-dev ca-certificates && \ + apt-get install -y ffmpeg tini libssl-dev ca-certificates git && \ rm -rf /var/lib/apt/lists/* # Install dependencies diff --git a/package.json b/package.json index e22759e..687ddc3 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "sync-fetch": "^0.3.1", "tsx": "3.8.2", "xbytes": "^1.7.0", - "ytdl-core": "^4.11.5", + "ytdl-core": "git+https://github.com/khlevon/node-ytdl-core.git#v4.11.4-patch.2", "ytsr": "^3.8.4" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index 0867c5e..ba158a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4486,18 +4486,17 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -ytdl-core@^4.11.5: - version "4.11.5" - resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.11.5.tgz#8cc3dc9e4884e24e8251250cfb56313a300811f0" - integrity sha512-27LwsW4n4nyNviRCO1hmr8Wr5J1wLLMawHCQvH8Fk0hiRqrxuIu028WzbJetiYH28K8XDbeinYW4/wcHQD1EXA== +"ytdl-core@git+https://github.com/khlevon/node-ytdl-core.git#v4.11.4-patch.2": + version "0.0.0-development" + resolved "git+https://github.com/khlevon/node-ytdl-core.git#87450450caabb91f81afa6e66758bf2f629664a1" dependencies: m3u8stream "^0.8.6" miniget "^4.2.2" sax "^1.1.3" -ytsr@^3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/ytsr/-/ytsr-3.8.2.tgz#10a60d0c1adcc3522b0810368c18dff49e875ba7" - integrity sha512-J+t+a1Ic6jL0Hd0zGX8eFn3uEKtXTf6naa96KO0q7H00GKBfCG8aXW55NAMnaBeUi9Hni6u1xKnf8xZF2F0E/A== +ytsr@^3.8.4: + version "3.8.4" + resolved "https://registry.yarnpkg.com/ytsr/-/ytsr-3.8.4.tgz#f279eb5a50a72a1135816ea69220f76030f62358" + integrity sha512-rrJo59vDDf98mz/Cuw7Y2YiuTwSm3cs4XsXrP6yjYDXYup/aE0lRxY6XMKR3mGOHKwgLouZqFq8QRllVVVN88w== dependencies: miniget "^4.2.2" From a32530855e3dfa7c066dd14ec2ff876f8e9f3e51 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sun, 10 Sep 2023 16:33:45 -0700 Subject: [PATCH 10/10] Release 2.4.3 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c31bf7..9f2774a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.3] - 2023-09-10 + ### Fixed - Switched ytdl-core to patched version @@ -269,7 +271,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.2...HEAD +[unreleased]: https://github.com/codetheweb/muse/compare/v2.4.3...HEAD +[2.4.3]: https://github.com/codetheweb/muse/compare/v2.4.2...v2.4.3 [2.4.2]: https://github.com/codetheweb/muse/compare/v2.4.1...v2.4.2 [2.4.1]: https://github.com/codetheweb/muse/compare/v2.4.0...v2.4.1 [2.4.0]: https://github.com/codetheweb/muse/compare/v2.3.1...v2.4.0 diff --git a/package.json b/package.json index 687ddc3..62f38e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "2.4.2", + "version": "2.4.3", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "repository": "git@github.com:codetheweb/muse.git", "author": "Max Isom ",