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

discord.User.AvatarDecoration not working because discord modified the json payload #348

Closed
vaporvee opened this issue Apr 7, 2024 · 8 comments · Fixed by #320 or #349
Closed

Comments

@vaporvee
Copy link

vaporvee commented Apr 7, 2024

Describe the bug
When i try to use discord.User.AvatarDecoration or AvatarDecorationURL() it returns null. When i tried it with postman directly on the api it seems that discord changed the json formatting for the user payload.

Error
The error which gets logged if there is any:

2024/04/07 20:30:59 ERROR recovered from panic in event listener name=bot_event_manager arg="runtime error: invalid memory address or nil pointer dereference" stack="goroutine 27 [running]:\nruntime/debug.Stack()\n\t/usr/local/go1.22.1.linux-amd64/src/runtime/debug/stack.go:24 +0x5e\ngithub.com/disgoorg/disgo/bot.(*eventManagerImpl).DispatchEvent.func1()\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/bot/event_manager.go:151 +0x8c\npanic({0x7dfdc0?, 0xbcd940?})\n\t/usr/local/go1.22.1.linux-amd64/src/runtime/panic.go:770 +0x132\nmain.init.func1(0xc0000000c0)\n\t/home/vaporvee/acecore/cmd_info.go:113 +0x514\nmain.applicationCommandInteractionCreate(0xc0000000c0)\n\t/home/vaporvee/acecore/handlers.go:74 +0x204\ngithub.com/disgoorg/disgo/bot.(*listenerFunc[...]).OnEvent(...)\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/bot/event_manager.go:64\ngithub.com/disgoorg/disgo/bot.(*eventManagerImpl).DispatchEvent(0xc00007a660, {0x9465d0, 0xc0000000c0})\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/bot/event_manager.go:170 +0x142\ngithub.com/disgoorg/disgo/handlers.handleInteraction({0x950a90, 0xc0000a3cc0}, 0x6, 0x0, 0x0, {0x94f530, 0xc0000b4370})\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/handlers/interaction_create_handler.go:43 +0x968\ngithub.com/disgoorg/disgo/handlers.gatewayHandlerInteractionCreate({0x950a90?, 0xc0000a3cc0?}, 0xc00045a2a8?, 0x7cfc40?, {{0x94f530?, 0xc0000b4370?}})\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/handlers/interaction_create_handler.go:16 +0x2f\ngithub.com/disgoorg/disgo/bot.(*genericGatewayEventHandler[...]).HandleGatewayEvent(0x418545?, {0x950a90?, 0xc0000a3cc0?}, 0xc000113320?, 0x100?, {0x948588?, 0xc0002fcb00?})\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/bot/event_manager.go:111 +0x4e\ngithub.com/disgoorg/disgo/bot.(*eventManagerImpl).HandleGatewayEvent(0xc00007a660, {0xc0002f63d8, 0x12}, 0x6, 0x0, {0x948588, 0xc0002fcb00})\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/bot/event_manager.go:136 +0x12c\ngithub.com/disgoorg/disgo/gateway.(*gatewayImpl).listen(0xc0001e2640, 0xc000133600)\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/gateway/gateway_impl.go:421 +0x16ef\ncreated by github.com/disgoorg/disgo/gateway.(*gatewayImpl).open in goroutine 1\n\t/home/vaporvee/go/pkg/mod/github.com/disgoorg/disgo@v0.17.2/gateway/gateway_impl.go:125 +0x453\n"

it panics obviously when i use the returned null value

To Reproduce
Steps to reproduce the behavior:

var user discord.User = e.SlashCommandInteractionData().User("user") // get the user from my slash command (other things work with that user value)
logrus.Debug(user.AvatarDecorationURL()) // returns null
logrus.Debug(user.AvatarDecorationURL()) // returns null too

Disgo Version(please complete the following information):

  • Version [e.g. v0.8.3]

Additional context
Also AccentColor seems to be broken too.

@sebm253
Copy link
Member

sebm253 commented Apr 7, 2024

a PR to fix this has already been created, but unfortunately we're waiting on Discord to merge the docs update (as always): #320

discord/discord-api-docs#6464

@sebm253 sebm253 linked a pull request Apr 7, 2024 that will close this issue
1 task
@MCausc78
Copy link
Contributor

MCausc78 commented Apr 7, 2024

a PR to fix this has already been created, but unfortunately we're waiting on Discord to merge the docs update (as always): #320

discord/discord-api-docs#6464

whats the sense of waiting on docs pr? are you scared that someone will kill disgo because it includes undocumented features?

@sebm253
Copy link
Member

sebm253 commented Apr 7, 2024

documentation changes that have yet to be merged are always subject to additional changes, whatever the reason might be

@vaporvee
Copy link
Author

vaporvee commented Apr 7, 2024

but whats about the accentcolor?
and btw i love how active the issues are

@sebm253
Copy link
Member

sebm253 commented Apr 7, 2024

not sure what you're experiencing with accent color, can you give more details? ideally in our discord server so we stay on topic in this issue

@sebm253
Copy link
Member

sebm253 commented Apr 8, 2024

@vaporvee
Copy link
Author

vaporvee commented Apr 8, 2024

The avatar decoration url has an .gif at the end wich breaks the url

@topi314
Copy link
Member

topi314 commented Apr 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants