merged from gramsrv upstream
This commit is contained in:
parent
79c64ee916
commit
21a0856587
651 changed files with 54774 additions and 4590 deletions
|
|
@ -128,6 +128,19 @@ func (r *Router) onMessagesGetInlineBotResults(ctx context.Context, req *tg.Mess
|
|||
results := r.inlines.registerCachedContext(ctx, now, bot.ID, userID, peer, cached)
|
||||
return r.tgBotInlineResults(ctx, userID, results), nil
|
||||
}
|
||||
if service := r.deps.ServiceBotInlineResults; service != nil && service.HandlesInlineBot(bot.ID) {
|
||||
results, handled, err := service.OnInlineQuery(ctx, bot.ID, userID, req.Query, req.Offset)
|
||||
if err != nil {
|
||||
return nil, internalErr()
|
||||
}
|
||||
if handled {
|
||||
if len(results.Results) > domain.MaxBotInlineResults {
|
||||
return nil, internalErr()
|
||||
}
|
||||
registered := r.inlines.registerCachedContext(ctx, now, bot.ID, userID, peer, results)
|
||||
return r.tgBotInlineResults(ctx, userID, registered), nil
|
||||
}
|
||||
}
|
||||
queryID, pending := r.inlines.registerWithCacheKeyContext(ctx, now, bot.ID, userID, peer, cacheKey)
|
||||
defer r.inlines.deregisterIfUnansweredContext(ctx, queryID)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue