diamondburned / arikawa

A Golang library and framework for the Discord API.
ISC License
481 stars 57 forks source link

discord: add AttachmentOption unmarshalling #416

Closed Benbebop closed 10 months ago

Benbebop commented 10 months ago

AttachmentOption isn't in UnknownCommandOption so it doesn't get unmarshalled properly.

func main() {
    var options discord.CommandOptions
    options.UnmarshalJSON([]byte(`[{"Type": 11, "Name": "attachment", "Description": "attachment"}]`))
    fmt.Println(reflect.TypeOf(options[0]))
}

*discord.UnknownCommandOption