parallel calls for telegram
This commit is contained in:
@@ -43,6 +43,7 @@ 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) {
|
||||||
|
go func() {
|
||||||
res := a.Ask(
|
res := a.Ask(
|
||||||
agent.WithText(
|
agent.WithText(
|
||||||
update.Message.Text,
|
update.Message.Text,
|
||||||
@@ -53,6 +54,7 @@ func (t *Telegram) Start(a *agent.Agent) {
|
|||||||
Text: res.Response,
|
Text: res.Response,
|
||||||
})
|
})
|
||||||
t.lastChatID = update.Message.Chat.ID
|
t.lastChatID = update.Message.Chat.ID
|
||||||
|
}()
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user