get sentfrom and fromchat when mychatmember hook

pull/5/head
CoiaPrant233 2023-01-18 16:59:03 +08:00 committed by GitHub
parent 5e115c98c7
commit 7afb333539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,8 @@ func (u *Update) SentFrom() *User {
return u.ShippingQuery.From
case u.PreCheckoutQuery != nil:
return u.PreCheckoutQuery.From
case u.MyChatMember != nil:
return &u.MyChatMember.From
default:
return nil
}
@ -160,6 +162,8 @@ func (u *Update) FromChat() *Chat {
return u.EditedChannelPost.Chat
case u.CallbackQuery != nil:
return u.CallbackQuery.Message.Chat
case u.MyChatMember != nil:
return &u.MyChatMember.Chat
default:
return nil
}