Skip to content

Commit

Permalink
Chat() *Chat logic expanded
Browse files Browse the repository at this point in the history
myChatMember and chatMember cases were added
  • Loading branch information
Aleksandr committed Jul 28, 2021
1 parent 33ea17f commit 65c920b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func (c *ChatInviteLink) ExpireDate() time.Time {
// ChatMemberUpdated object represents changes in the status of a chat member.
type ChatMemberUpdated struct {
// Chat where the user belongs to.
Chat Chat `json:"chat"`
Chat *Chat `json:"chat"`

// From which user the action was triggered.
From User `json:"from"`
From *User `json:"from"`

// Unixtime, use ChatMemberUpdated.Time() to get time.Time
Unixtime int64 `json:"date"`
Expand Down
4 changes: 4 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func (c *nativeContext) Chat() *Chat {
return c.message.Chat
case c.callback != nil && c.callback.Message != nil:
return c.callback.Message.Chat
case c.myChatMember != nil:
return c.myChatMember.Chat
case c.chatMember != nil:
return c.chatMember.Chat
default:
return nil
}
Expand Down

0 comments on commit 65c920b

Please sign in to comment.