From 7afb333539f3df5325a7dd4aa6cb8e7743e9b954 Mon Sep 17 00:00:00 2001 From: CoiaPrant233 <112553141+CoiaPrant233@users.noreply.github.com> Date: Wed, 18 Jan 2023 16:59:03 +0800 Subject: [PATCH] get sentfrom and fromchat when mychatmember hook --- types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types.go b/types.go index 8d9a67f..7c7387c 100644 --- a/types.go +++ b/types.go @@ -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 }