parallel calls for telegram
This commit is contained in:
@@ -43,16 +43,18 @@ func (t *Telegram) Start(a *agent.Agent) {
|
|||||||
|
|
||||||
opts := []bot.Option{
|
opts := []bot.Option{
|
||||||
bot.WithDefaultHandler(func(ctx context.Context, b *bot.Bot, update *models.Update) {
|
bot.WithDefaultHandler(func(ctx context.Context, b *bot.Bot, update *models.Update) {
|
||||||
res := a.Ask(
|
go func() {
|
||||||
agent.WithText(
|
res := a.Ask(
|
||||||
update.Message.Text,
|
agent.WithText(
|
||||||
),
|
update.Message.Text,
|
||||||
)
|
),
|
||||||
b.SendMessage(ctx, &bot.SendMessageParams{
|
)
|
||||||
ChatID: update.Message.Chat.ID,
|
b.SendMessage(ctx, &bot.SendMessageParams{
|
||||||
Text: res.Response,
|
ChatID: update.Message.Chat.ID,
|
||||||
})
|
Text: res.Response,
|
||||||
t.lastChatID = update.Message.Chat.ID
|
})
|
||||||
|
t.lastChatID = update.Message.Chat.ID
|
||||||
|
}()
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user