From ece7c55d24af0c739c4ec008afa5feda6f8c14e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Savchuk Date: Mon, 29 Apr 2024 15:20:10 +0300 Subject: [PATCH] feat: return business in `Update.Msg()` --- types_gen_ext.go | 4 ++++ types_gen_ext_test.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/types_gen_ext.go b/types_gen_ext.go index c77384b..6dce6d5 100644 --- a/types_gen_ext.go +++ b/types_gen_ext.go @@ -1250,6 +1250,10 @@ func (update *Update) Msg() *Message { return update.EditedChannelPost case update.CallbackQuery != nil && update.CallbackQuery.Message != nil && update.CallbackQuery.Message.Message != nil: return update.CallbackQuery.Message.Message + case update.BusinessMessage != nil: + return update.BusinessMessage + case update.EditedBusinessMessage != nil: + return update.EditedBusinessMessage default: return nil } diff --git a/types_gen_ext_test.go b/types_gen_ext_test.go index 92dbc44..0699322 100644 --- a/types_gen_ext_test.go +++ b/types_gen_ext_test.go @@ -1124,6 +1124,8 @@ func TestUpdate_Msg(t *testing.T) { Message: msg, }}}, msg}, {&Update{CallbackQuery: &CallbackQuery{}}, nil}, + {&Update{BusinessMessage: msg}, msg}, + {&Update{EditedBusinessMessage: msg}, msg}, } { assert.Equal(t, test.Message, test.Update.Msg()) }