(new): rich message support
Golang lint / lint (pull_request) Successful in 1m20s
Golang lint / lint (push) Successful in 4m8s

(fix): runtime reliability
(tests): regression coverage
(doc): v1.1 release notes
This commit is contained in:
2026-08-12 16:34:44 +03:00
parent 48ddf66540
commit f03a081ed6
83 changed files with 6122 additions and 1925 deletions
+66 -1
View File
@@ -318,6 +318,15 @@ func TestPrepareUpdateCtxContract(t *testing.T) {
wantFrom: true,
wantFromID: 115,
},
{
name: "anonymous poll answer",
update: &tgapi.Update{
Type: tgapi.UpdateTypePollAnswer,
PollAnswer: &tgapi.PollAnswer{VoterChat: tgapi.Chat{ID: -2007}},
},
wantChat: true,
wantChatID: -2007,
},
{
name: "message reaction",
update: &tgapi.Update{
@@ -368,8 +377,64 @@ func TestPrepareUpdateCtxContract(t *testing.T) {
name: "message reaction count",
update: &tgapi.Update{
Type: tgapi.UpdateTypeMessageReactionCount,
MessageReactionCount: &tgapi.MessageReactionCountUpdated{},
MessageReactionCount: &tgapi.MessageReactionCountUpdated{Chat: &tgapi.Chat{ID: -2008}},
},
wantChat: true,
wantChatID: -2008,
},
{
name: "guest message",
update: &tgapi.Update{
Type: tgapi.UpdateTypeGuestMessage,
GuestMessage: &tgapi.Message{
From: &tgapi.User{ID: 119},
Chat: &tgapi.Chat{ID: -2009},
},
},
wantMsg: true,
wantFrom: true,
wantFromID: 119,
wantChat: true,
wantChatID: -2009,
},
{
name: "deleted business messages",
update: &tgapi.Update{
Type: tgapi.UpdateTypeDeletedBusinessMessages,
DeletedBusinessMessages: &tgapi.BusinessMessagesDeleted{Chat: tgapi.Chat{ID: -2010}},
},
wantChat: true,
wantChatID: -2010,
},
{
name: "managed bot",
update: &tgapi.Update{
Type: tgapi.UpdateTypeManagedBot,
ManagedBot: &tgapi.ManagedBotUpdated{User: tgapi.User{ID: 120}},
},
wantFrom: true,
wantFromID: 120,
},
{
name: "subscription",
update: &tgapi.Update{
Type: tgapi.UpdateTypeSubscription,
Subscription: &tgapi.BotSubscriptionUpdated{User: tgapi.User{ID: 121}},
},
wantFrom: true,
wantFromID: 121,
},
{
name: "giveaway chat boost has no user",
update: &tgapi.Update{
Type: tgapi.UpdateTypeChatBoost,
ChatBoost: &tgapi.ChatBoostUpdated{
Chat: tgapi.Chat{ID: -2011},
Boost: tgapi.ChatBoost{Source: tgapi.ChatBoostSource{Source: "giveaway"}},
},
},
wantChat: true,
wantChatID: -2011,
},
}