(new): support Bot API 10.3
Golang lint / lint (push) Failing after 1m37s

(fix): finalize v2 contracts
(tests): cover v2 migration
(doc): prepare release guidance
This commit is contained in:
2026-09-08 23:21:38 +03:00
parent 24040fe164
commit d78526242b
88 changed files with 2321 additions and 918 deletions
+31 -7
View File
@@ -9,8 +9,8 @@ import (
"strconv"
"strings"
"git.scuroneko.dev/scuroneko/laniakea/tgapi"
"git.scuroneko.dev/scuroneko/laniakea/tgrich"
"git.scuroneko.dev/scuroneko/laniakea/v2/tgapi"
"git.scuroneko.dev/scuroneko/laniakea/v2/tgrich"
"git.scuroneko.dev/scuroneko/sneklog/v2"
)
@@ -106,7 +106,11 @@ func (ctx *MessageContext) buildEditMessageTextParams(messageID int, keyboard *I
params.ParseMode = parseMode
}
if keyboard != nil {
params.ReplyMarkup = keyboard.Get()
markup, err := keyboard.Get()
if err != nil {
return params, fmt.Errorf("keyboard get error: %w", err)
}
params.ReplyMarkup = markup
}
return params, nil
}
@@ -218,7 +222,12 @@ func (ctx *MessageContext) editPhotoText(messageID int, text string, kb *InlineK
return nil
}
if kb != nil {
params.ReplyMarkup = kb.Get()
markup, err := kb.Get()
if err != nil {
ctx.Logger.Errorln(err)
return nil
}
params.ReplyMarkup = markup
}
msg, _, err := ctx.API.EditMessageCaptionWithContext(ctx.Context(), params)
@@ -275,7 +284,12 @@ func (ctx *MessageContext) answer(text string, keyboard *InlineKeyboard, parseMo
ParseMode: parseMode,
}
if keyboard != nil {
params.ReplyMarkup = keyboard.Get()
markup, err := keyboard.Get()
if err != nil {
ctx.Logger.Errorln(err)
return nil
}
params.ReplyMarkup = markup
}
if ctx.Msg.MessageThreadID > 0 {
params.MessageThreadID = ctx.Msg.MessageThreadID
@@ -406,7 +420,12 @@ func (ctx *MessageContext) answerPhoto(photoID, text string, kb *InlineKeyboard,
Photo: photoID,
}
if kb != nil {
params.ReplyMarkup = kb.Get()
markup, err := kb.Get()
if err != nil {
ctx.Logger.Errorln(err)
return nil
}
params.ReplyMarkup = markup
}
if ctx.Msg.MessageThreadID > 0 {
params.MessageThreadID = ctx.Msg.MessageThreadID
@@ -855,7 +874,12 @@ func (ctx *MessageContext) richAnswer(rich tgapi.InputRichMessage, keyboard *Inl
RichMessage: rich,
}
if keyboard != nil {
params.ReplyMarkup = keyboard.Get()
markup, err := keyboard.Get()
if err != nil {
ctx.Logger.Errorln(err)
return nil
}
params.ReplyMarkup = markup
}
if ctx.Msg.MessageThreadID > 0 {
params.MessageThreadID = int64(ctx.Msg.MessageThreadID)