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

DiscordGo: Encountering HTTP 400 Bad Request Error for Button Components Without Emojis #1478

Closed
Rosa17a opened this issue Jan 5, 2024 · 1 comment

Comments

@Rosa17a
Copy link

Rosa17a commented Jan 5, 2024

Hello DiscordGo maintainers,

I've encountered an issue with the DiscordGo package (v0.27.1) related to using buttons in messages. Despite not having any emojis in the buttons, I am consistently receiving an HTTP 400 Bad Request error.

This is one example of my message
&discordgo.MessageSend{ Content: content, Components: []discordgo.MessageComponent{ discordgo.ActionsRow{ Components: []discordgo.MessageComponent{ discordgo.Button{ Label: "something", Style: discordgo.PrimaryButton, CustomID: "something", }, discordgo.Button{ Label: "something else", Style: discordgo.SecondaryButton, CustomID: "something_else"", }, }, }, }, }

Here is an example of such error message:
HTTP 400 Bad Request, {"message": "Invalid Form Body", "code": 50035, "errors": {"components": {"0": {"components": {"1": {"emoji": {"name": {"_errors": [{"code": "BUTTON_COMPONENT_INVALID_EMOJI", "message": "Invalid emoji"}]}}}}}}}}
This error occurs even when emojis are not used in the button components. Here's a brief overview of the scenario:

  • Using DiscordGo to send messages with buttons.
  • No emojis are included in the button components.
  • The error appears upon message sending.

I would appreciate any insights or solutions to this problem. Could this be an issue with the library handling button components without emojis, or am I missing a step in the implementation?

Thank you for your assistance.

Best regards,
Rosa17a

@FedorLap2006
Copy link
Collaborator

FedorLap2006 commented Jan 5, 2024

This is a known problem and has been resolved in f70a015. However, since it's not tagged yet, you'd have to use the @master version (which can be retrieved by running go get -u github.com/bwmarrin/discordgo@master)

vennekilde added a commit to vennekilde/gw2-alliance-bot that referenced this issue Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants