cleanup code

This commit is contained in:
stefanodvx 2025-04-15 10:46:54 +02:00
parent 26452d0f53
commit c06c7958e2
10 changed files with 64 additions and 14 deletions

View file

@ -41,11 +41,12 @@ func InlineDownloadResultHandler(
bot *gotgbot.Bot,
ctx *ext.Context,
) error {
dlCtx, ok := core.InlineTasks[ctx.ChosenInlineResult.ResultId]
taskID := ctx.ChosenInlineResult.ResultId
dlCtx, ok := core.GetTask(taskID)
if !ok {
return nil
}
defer delete(core.InlineTasks, ctx.ChosenInlineResult.ResultId)
defer core.DeleteTask(taskID)
mediaChan := make(chan *models.Media, 1)
errChan := make(chan error, 1)