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

400 Bad Request on long ;custom command responses #82

Open
stdNullPtr opened this issue Jul 19, 2021 · 7 comments
Open

400 Bad Request on long ;custom command responses #82

stdNullPtr opened this issue Jul 19, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@stdNullPtr
Copy link

When executing a custom command like ItemList - ;custom "ItemList" default
If the list is too big we get:

Traceback (most recent call last): File "/home/steam/.local/share/virtualenvs/pavlov-bot-WoHbs0yw/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "/home/steam/pavlov-bot/bot/cogs/pavlov_admin.py", line 160, in custom await ctx.send(embed=embed) File "/home/steam/.local/share/virtualenvs/pavlov-bot-WoHbs0yw/lib/python3.8/site-packages/discord/abc.py", line 1065, in send data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, File "/home/steam/.local/share/virtualenvs/pavlov-bot-WoHbs0yw/lib/python3.8/site-packages/discord/http.py", line 254, in request raise HTTPException(r, data) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.fields.0.value: Must be 1024 or fewer in length.

The expected behaviour should be message split into separate messages for response since discord restricts message length on 1 message.

@stdNullPtr stdNullPtr added the bug Something isn't working label Jul 19, 2021
@invicta-nz
Copy link
Collaborator

@Xaxoxuxu I can't seem to replicate on main. Were you running this against a beta server by chance?

@stdNullPtr
Copy link
Author

Definitely not on beta server. Can you try on a map with more weapons? Like star_wars_zombies.

@invicta-nz
Copy link
Collaborator

@Xaxoxuxu Ah.. just noticed you were using custom command. Pavlov-bot supports ;itemlist <server> command and this still returns the full list.

@stdNullPtr
Copy link
Author

@Xaxoxuxu Ah.. just noticed you were using custom command. Pavlov-bot supports ;itemlist <server> command and this still returns the full list.

@invicta-nz Just tried it - works like a charm, returning the full list.

@invicta-nz
Copy link
Collaborator

It does show a bug in the ;custom command, but this is very infrequently used, so likely will be in the very low priority bucket. Could either trim the return before 1024k or use react pager like other long lists.

@invicta-nz invicta-nz changed the title 400 Bad Request on long responses 400 Bad Request on long ;custom command responses Jul 23, 2021
@stdNullPtr
Copy link
Author

I believe trimming would be a less desired solution since custom weapons appear at the bottom of the list and most of the time that is what you will want (?)

@Derpyhsi
Copy link
Contributor

No need to use ;custom for itemlist anymore. I fixed ;itemlist recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants