1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-05 19:57:02 +00:00

discord: Add missing NumberOption MarshalJSON

This commit is contained in:
diamondburned 2021-12-29 11:10:59 -08:00
parent 5c4a989746
commit c14e68ac77
No known key found for this signature in database
GPG key ID: D78C4471CE776659
2 changed files with 13 additions and 0 deletions

View file

@ -708,3 +708,15 @@ func (m *MentionableOption) MarshalJSON() ([]byte, error) {
raw: (*raw)(m),
})
}
// MarshalJSON marshals NumberOption to JSON with the "type" field.
func (n *NumberOption) MarshalJSON() ([]byte, error) {
type raw NumberOption
return json.Marshal(struct {
Type CommandOptionType `json:"type"`
*raw
}{
Type: n.Type(),
raw: (*raw)(n),
})
}

View file

@ -10,6 +10,7 @@ types=(
ChannelOption
RoleOption
MentionableOption
NumberOption
)
for ((i = 0; i < ${#types[@]}; i++)); {