diff --git a/discord/audit_log.go b/discord/audit_log.go index 17ddadc9..a1909637 100644 --- a/discord/audit_log.go +++ b/discord/audit_log.go @@ -130,9 +130,10 @@ type AuditLog struct { func (l *AuditLog) UnmarshalJSON(data []byte) error { type auditLog AuditLog var v struct { - Integrations []UnmarshalIntegration `json:"integrations"` - Threads []UnmarshalChannel `json:"threads"` - Webhooks []UnmarshalWebhook `json:"webhooks"` + ApplicationCommands []UnmarshalApplicationCommand `json:"application_commands"` + Integrations []UnmarshalIntegration `json:"integrations"` + Threads []UnmarshalChannel `json:"threads"` + Webhooks []UnmarshalWebhook `json:"webhooks"` auditLog } if err := json.Unmarshal(data, &v); err != nil { @@ -140,6 +141,13 @@ func (l *AuditLog) UnmarshalJSON(data []byte) error { } *l = AuditLog(v.auditLog) + if v.ApplicationCommands != nil { + l.ApplicationCommands = make([]ApplicationCommand, len(v.ApplicationCommands)) + for i := range v.ApplicationCommands { + l.ApplicationCommands[i] = v.ApplicationCommands[i].ApplicationCommand + } + } + if v.Integrations != nil { l.Integrations = make([]Integration, len(v.Integrations)) for i := range v.Integrations {