From 28bf4ef258e912776a9ead2fef9c2d2bd54dde33 Mon Sep 17 00:00:00 2001 From: VTGare Date: Sun, 15 Dec 2024 20:17:14 +0200 Subject: [PATCH] fix: bookmarks context timeout --- commands/user.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/user.go b/commands/user.go index b6b4677..96a5f61 100644 --- a/commands/user.go +++ b/commands/user.go @@ -690,7 +690,8 @@ func bookmarks(b *bot.Bot) func(*gumi.Ctx) error { } wg := dgoutils.NewWidget(gctx.Session, gctx.Event.Author.ID, pages) - wg.WithCallback(func(wa dgoutils.WidgetAction, i int) error { + wg.WithCallback(func(_ dgoutils.WidgetAction, i int) error { + ctx := context.WithoutCancel(ctx) if wg.Pages[i] != nil { return nil } @@ -725,6 +726,7 @@ func bookmarks(b *bot.Bot) func(*gumi.Ctx) error { wg.Pages[i] = page return nil }) + return wg.Start(gctx.Event.ChannelID) } }