bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.11k stars 813 forks source link

Webhook functions return `Role` instead of `Webhook` #1495

Closed Cyb3r-Jak3 closed 9 months ago

Cyb3r-Jak3 commented 9 months ago

The functions WebhookEdit, WebhookEditWithToken both return the Role struct over the Webhook one.

Happy to make a PR for this but wanted to make it was intended for weird reasons beforehand.

Earlopain commented 9 months ago

This looks like a bug to me, webhook and roles are not structurally compatible. If you call this method and check the return value, you should see that most fields are default initialized. (I haven't tested this myself).

Docs: https://discord.com/developers/docs/resources/webhook#modify-webhook https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token

There are also some missing fields on the webhook struct (last 3 from https://discord.com/developers/docs/resources/webhook#webhook-object) and a missing webhook type Application (3) if you want to do some updates for that in a separate PR.