Merge pull request #5 from CoiaPrant233/bot-api-6.4-patch
get sentfrom and fromchat when mychatmember hookbot-api-6.4
commit
303c6995b9
4
types.go
4
types.go
|
@ -134,6 +134,8 @@ func (u *Update) SentFrom() *User {
|
||||||
return u.ShippingQuery.From
|
return u.ShippingQuery.From
|
||||||
case u.PreCheckoutQuery != nil:
|
case u.PreCheckoutQuery != nil:
|
||||||
return u.PreCheckoutQuery.From
|
return u.PreCheckoutQuery.From
|
||||||
|
case u.MyChatMember != nil:
|
||||||
|
return &u.MyChatMember.From
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -160,6 +162,8 @@ func (u *Update) FromChat() *Chat {
|
||||||
return u.EditedChannelPost.Chat
|
return u.EditedChannelPost.Chat
|
||||||
case u.CallbackQuery != nil:
|
case u.CallbackQuery != nil:
|
||||||
return u.CallbackQuery.Message.Chat
|
return u.CallbackQuery.Message.Chat
|
||||||
|
case u.MyChatMember != nil:
|
||||||
|
return &u.MyChatMember.Chat
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue