lew-nay / Moosic

Discord music bot.
GNU General Public License v3.0
1 stars 0 forks source link

Max Discord Char Limit Error #4

Closed Banoulka closed 1 year ago

Banoulka commented 1 year ago

When queueing a large playlist: https://www.youtube.com/playlist?list=PLEijU2q67K_twQnJ06-3DnrvsAdEii_MQ

After using /queue

This error occurs where the discord API mentions the max character limit of a text is 2000. A fix will have to involve printing each queue item and constantly checking the message to ensure that the characters stay under the limit

0|bot  | content[BASE_TYPE_MAX_LENGTH]: Must be 2000 or fewer in length.
0|bot  |     at handleErrors (/home/banoulka/apps/nb-moosic/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:152:10)
0|bot  |     at runMicrotasks (<anonymous>)
0|bot  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
0|bot  |     at SequentialHandler.runRequest (/home/banoulka/apps/nb-moosic/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:399:20)
0|bot  |     at SequentialHandler.queueRequest (/home/banoulka/apps/nb-moosic/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:169:11)
0|bot  |     at REST.request (/home/banoulka/apps/nb-moosic/node_modules/@discordjs/rest/src/lib/REST.ts:343:20)
0|bot  |     at InteractionWebhook.send (/home/banoulka/apps/nb-moosic/node_modules/discord.js/src/structures/Webhook.js:222:15) {
0|bot  |   requestBody: {
0|bot  |     files: [],
0|bot  |     json: {
0|bot  |       content: 'Current queue: \n' +
0|bot  |         '**[1]:** 1. Blue Swede - Hooked on a Feeling - Joel Gustafsson\n' +
0|bot  |         '**[2]:** 2. Raspberries - Go All The Way - Joel Gustafsson\n' +
0|bot  |         '**[3]:** 3. Norman Greenbaum - Spirit In The Sky - Joel Gustafsson\n' +
0|bot  |         '**[4]:** 4. David Bowie - Moonage Daydream - Joel Gustafsson\n' +
0|bot  |         '**[5]:** 5. Elvin Bishop - Fooled Around and Fell in Love - Joel Gustafsson\n' +
0|bot  |         "**[6]:** 6. 10CC - I'm Not in Love - Joel Gustafsson\n" +
0|bot  |         '**[7]:** 7. Jackson 5 - I Want You Back - Joel Gustafsson\n' +
0|bot  |         '**[8]:** 9. The Runaways - Cherry Bomb - Joel Gustafsson\n' +
0|bot  |         '**[9]:** 10. Rupert Holmes - Escape (The Piña Colada Song) - Joel Gustafsson\n' +
0|bot  |         "**[10]:** 12. Marvin Gaye & Tammi Terrell - Ain't No Mountain High Enough - Joel Gustafsson\n" +
0|bot  |         '**[11]:** Come A Little Bit Closer - Jay & The Americans | TV Spot [Guardians of the Galaxy Volume 2] - Soul Music Group\n' +
0|bot  |         '**[12]:** Surrender - Cheap Trick [Guardians of the Galaxy: Vol. 2] Official Sondtrack - Soul Music Group\n' +
0|bot  |         '**[13]:** Flashlight - Parliament [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[14]:** Fox On The Run - The Sweet [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[15]:** Lake Shore Drive - Aliotta Haynes Jeremiah [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[16]:** Bring It On Home To Me - Sam Cooke [Guardians of the Galaxy Vol 2: Official Soundtrack] - Soul Music Group\n' +
0|bot  |         '**[17]:** Southern Nights - Glen Campbell [Guardians of the Galaxy: Vol 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[18]:** My Sweet Lord - George Harrison [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         "**[19]:** Brandy You're A Fine Girl - Looking Glass [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n" +
0|bot  |         '**[20]:** Guardians Inferno - The Sneepers [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[21]:** The Chain - Fleetwood Mac [Guardians of the Galaxy: Vol. 2] Official Soundtrack - Soul Music Group\n' +
0|bot  |         '**[22]:** Where is the Last Infinity Stone of the MCU? (Soul Stone) - Gubz\n',
0|bot  |       tts: false,
0|bot  |       nonce: undefined,
0|bot  |       embeds: undefined,
0|bot  |       components: undefined,
0|bot  |       username: undefined,
0|bot  |       avatar_url: undefined,
0|bot  |       allowed_mentions: undefined,
0|bot  |       flags: undefined,
0|bot  |       message_reference: undefined,
0|bot  |       attachments: undefined,
0|bot  |       sticker_ids: undefined,
0|bot  |       thread_name: undefined
0|bot  |     }
0|bot  |   },
0|bot  |   rawError: {
0|bot  |     message: 'Invalid Form Body',
0|bot  |     code: 50035,
0|bot  |     errors: { content: [Object] }
0|bot  |   },
0|bot  |   code: 50035,
0|bot  |   status: 400,
0|bot  |   method: 'POST',
0|bot  |   url: 'https://discord.com/api/v10/webhooks/1129062555348914237/aW50ZXJhY3Rpb246MTEzNjI0MDU4ODY2MDk0OTAzMzpxSGpsenhLanJ2U1pxMXNJSm9Dd1JnOTFwSjgyMklOaFJ6bW1oNmdPNTBDYjRQZU40TjFieE95U05OMUl1OUxteG54YTE5V0lKZ05mR0FXM1JXajVPSVRZZ3VSZ2h1Y1lNNmtzSFh4N3NhdmRmanVXUFdDd1RSRDRGTDhwNE5uSQ?wait=true'
0|bot  | }
Banoulka commented 1 year ago

fixed in #11