Skip to content

Commit

Permalink
Merge branch 'master' into selects-component
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorLap2006 committed Jun 18, 2021
2 parents 9b358e5 + afb1057 commit 0640e7f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components.go
Expand Up @@ -20,10 +20,13 @@ type MessageComponent interface {
Type() ComponentType
}

// UnmarshableMessageComponent a helper for components which need to be unmarshaled (like the ones in message object).
// Since interfaces can't be unmarshaled this exists.
type UnmarshableMessageComponent struct {
MessageComponent
}

// UnmarshalJSON is a helper function to unmarshal MessageComponent object.
func (umc *UnmarshableMessageComponent) UnmarshalJSON(src []byte) (err error) {
var v struct {
Type ComponentType `json:"type"`
Expand Down

0 comments on commit 0640e7f

Please sign in to comment.