Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 DiscordAPIError - Search command error if no results #1441

Closed
Mirasaki opened this issue Jun 13, 2023 · 3 comments · Fixed by #1442
Closed

🐛 DiscordAPIError - Search command error if no results #1441

Mirasaki opened this issue Jun 13, 2023 · 3 comments · Fixed by #1442
Labels
stale Issue has been marked as stale

Comments

@Mirasaki
Copy link
Contributor

Describe the bug
When using a /search query and getting results with names over 25 characters, an API error is thrown for the Select Menu

How To Reproduce
Steps to reproduce the behavior:

  1. /search https://www.youtube.com/watch?v=5NvUjGrwl_g&list=PLjtf1x3BacZauF2uL-v-grcEk4JmVWvMx&index=39
  2. Error: DiscordAPIError[50035]: Invalid Form Body
    components[0].components[0].options[BASE_TYPE_BAD_LENGTH]: Must be between 1 and 25 in length.
    at async Object.execute (/home/mirasaki/projects/node/discord/evobot/commands/search.ts:58:22)

Expected behavior
Format/slice the name to comply with API rules/restrictions

Environment (add if possible)

  • Node.js version: v19.0.1

Additional information & screenshots
Add any other context or screenshots about the problem here.

@eritislami
Copy link
Owner

eritislami commented Jun 13, 2023

I will look into this but just for your information the /search command is only for text queries not links

@Mirasaki
Copy link
Contributor Author

Oh it's actually because there's over 25 results in the StringSelectMenuBuilder, where 25 is max

Do you mind if I start a PR myself? Interested in doing some of the other issues as well

@Mirasaki Mirasaki changed the title 🐛 DiscordAPIError - Search command error for long string 🐛 DiscordAPIError - Search command error if no results Jun 13, 2023
@stale
Copy link

stale bot commented Aug 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has been marked as stale label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue has been marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants