chore(Interaction): remove authorizing_integration_owners workaround

This commit is contained in:
Fedor Lapshin
2024-06-20 17:54:31 +03:00
parent 9e879ff84f
commit 879979c396

View File

@@ -261,8 +261,7 @@ type interaction Interaction
type rawInteraction struct {
interaction
Data json.RawMessage `json:"data"`
AuthorizingIntegrationOwners map[ApplicationIntegrationType]json.Number `json:"authorizing_integration_owners"`
Data json.RawMessage `json:"data"`
}
// UnmarshalJSON is a method for unmarshalling JSON object to Interaction.
@@ -275,13 +274,6 @@ func (i *Interaction) UnmarshalJSON(raw []byte) error {
*i = Interaction(tmp.interaction)
// TODO: remove when https://github.com/discord/discord-api-docs/issues/6730 is fixed.
authIntegrationOwners := make(map[ApplicationIntegrationType]string)
for k, v := range tmp.AuthorizingIntegrationOwners {
authIntegrationOwners[k] = v.String()
}
i.AuthorizingIntegrationOwners = authIntegrationOwners
switch tmp.Type {
case InteractionApplicationCommand, InteractionApplicationCommandAutocomplete:
v := ApplicationCommandInteractionData{}