Skip to content

Commit

Permalink
markup: fix web_app conflict with switch_inline_query_current_chat
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Oct 5, 2022
1 parent b8cc28a commit 65f19ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ type InlineButton struct {
}

// MarshalJSON implements json.Marshaler interface.
// It needed to avoid InlineQueryChat and Login fields conflict.
// If you have Login field in your button, InlineQueryChat must be skipped.
// It needed to avoid InlineQueryChat and Login or WebApp fields conflict.
// If you have Login or WebApp field in your button, InlineQueryChat must be skipped.
func (t *InlineButton) MarshalJSON() ([]byte, error) {
type IB InlineButton

if t.Login != nil {
if t.Login != nil || t.WebApp != nil {
return json.Marshal(struct {
IB
InlineQueryChat string `json:"switch_inline_query_current_chat,omitempty"`
Expand Down

0 comments on commit 65f19ba

Please sign in to comment.