From 9ef9a240a400998fe67e9d8848f585fe67e17fd6 Mon Sep 17 00:00:00 2001 From: ScuroNeko Date: Thu, 12 Feb 2026 11:47:58 +0300 Subject: [PATCH] v0.5.0 --- bot.go | 6 ------ tgapi/api.go | 2 +- tgapi/messages_types.go | 8 +++++--- utils.go | 6 ++++++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/bot.go b/bot.go index 884a3e2..d3cc5e9 100644 --- a/bot.go +++ b/bot.go @@ -262,12 +262,6 @@ func (b *Bot) Run() { middleware.Execute(ctx, b.dbContext) } - for _, plugin := range b.plugins { - if plugin.UpdateListener != nil { - (*plugin.UpdateListener)(ctx, b.dbContext) - } - } - if u.CallbackQuery != nil { b.handleCallback(u, ctx) } else { diff --git a/tgapi/api.go b/tgapi/api.go index bb3ba9f..4cda187 100644 --- a/tgapi/api.go +++ b/tgapi/api.go @@ -23,7 +23,7 @@ type Api struct { func NewAPI(token string) *Api { l := slog.CreateLogger().Level(utils.GetLoggerLevel()).Prefix("API") l.AddWriter(l.CreateJsonStdoutWriter()) - client := &http.Client{Timeout: time.Second * 10} + client := &http.Client{Timeout: time.Second * 45} return &Api{token, client, l} } func (api *Api) CloseApi() error { diff --git a/tgapi/messages_types.go b/tgapi/messages_types.go index 7a81c33..3662b20 100644 --- a/tgapi/messages_types.go +++ b/tgapi/messages_types.go @@ -1,5 +1,7 @@ package tgapi +import "git.nix13.pw/scuroneko/extypes" + type MessageReplyMarkup struct { InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` } @@ -26,9 +28,9 @@ type Message struct { Text string `json:"text"` - Photo []*PhotoSize `json:"photo,omitempty"` - Caption string `json:"caption,omitempty"` - CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` + Photo extypes.Slice[*PhotoSize] `json:"photo,omitempty"` + Caption string `json:"caption,omitempty"` + CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Date int `json:"date"` EditDate int `json:"edit_date"` diff --git a/utils.go b/utils.go index 7dcedde..debe5f1 100644 --- a/utils.go +++ b/utils.go @@ -1,5 +1,7 @@ package laniakea +import "git.nix13.pw/scuroneko/laniakea/utils" + func Ptr[T any](v T) *T { return &v } func Val[T any](p *T, def T) T { @@ -8,3 +10,7 @@ func Val[T any](p *T, def T) T { } return def } + +const VersionString = utils.VersionString + +var EscapeMarkdown = utils.EscapeMarkdown