mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-06-16 15:41:26 +00:00
discord: Add missing NumberOption MarshalJSON
This commit is contained in:
parent
5c4a989746
commit
c14e68ac77
|
@ -708,3 +708,15 @@ func (m *MentionableOption) MarshalJSON() ([]byte, error) {
|
||||||
raw: (*raw)(m),
|
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),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ types=(
|
||||||
ChannelOption
|
ChannelOption
|
||||||
RoleOption
|
RoleOption
|
||||||
MentionableOption
|
MentionableOption
|
||||||
|
NumberOption
|
||||||
)
|
)
|
||||||
|
|
||||||
for ((i = 0; i < ${#types[@]}; i++)); {
|
for ((i = 0; i < ${#types[@]}; i++)); {
|
||||||
|
|
Loading…
Reference in a new issue