This commit is contained in:
2026-02-12 11:47:58 +03:00
parent 3912beefac
commit 9ef9a240a4
4 changed files with 12 additions and 10 deletions

6
bot.go
View File

@@ -262,12 +262,6 @@ func (b *Bot) Run() {
middleware.Execute(ctx, b.dbContext) middleware.Execute(ctx, b.dbContext)
} }
for _, plugin := range b.plugins {
if plugin.UpdateListener != nil {
(*plugin.UpdateListener)(ctx, b.dbContext)
}
}
if u.CallbackQuery != nil { if u.CallbackQuery != nil {
b.handleCallback(u, ctx) b.handleCallback(u, ctx)
} else { } else {

View File

@@ -23,7 +23,7 @@ type Api struct {
func NewAPI(token string) *Api { func NewAPI(token string) *Api {
l := slog.CreateLogger().Level(utils.GetLoggerLevel()).Prefix("API") l := slog.CreateLogger().Level(utils.GetLoggerLevel()).Prefix("API")
l.AddWriter(l.CreateJsonStdoutWriter()) l.AddWriter(l.CreateJsonStdoutWriter())
client := &http.Client{Timeout: time.Second * 10} client := &http.Client{Timeout: time.Second * 45}
return &Api{token, client, l} return &Api{token, client, l}
} }
func (api *Api) CloseApi() error { func (api *Api) CloseApi() error {

View File

@@ -1,5 +1,7 @@
package tgapi package tgapi
import "git.nix13.pw/scuroneko/extypes"
type MessageReplyMarkup struct { type MessageReplyMarkup struct {
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
} }
@@ -26,7 +28,7 @@ type Message struct {
Text string `json:"text"` Text string `json:"text"`
Photo []*PhotoSize `json:"photo,omitempty"` Photo extypes.Slice[*PhotoSize] `json:"photo,omitempty"`
Caption string `json:"caption,omitempty"` Caption string `json:"caption,omitempty"`
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

View File

@@ -1,5 +1,7 @@
package laniakea package laniakea
import "git.nix13.pw/scuroneko/laniakea/utils"
func Ptr[T any](v T) *T { return &v } func Ptr[T any](v T) *T { return &v }
func Val[T any](p *T, def T) T { func Val[T any](p *T, def T) T {
@@ -8,3 +10,7 @@ func Val[T any](p *T, def T) T {
} }
return def return def
} }
const VersionString = utils.VersionString
var EscapeMarkdown = utils.EscapeMarkdown