feat(webhook): queue incoming messages

This commit is contained in:
2026-06-05 19:21:42 +08:00
parent dec8854ec9
commit d756473d91
7 changed files with 300 additions and 42 deletions
@@ -13,6 +13,7 @@ import (
telegramchannel "github.com/gochat/gochat/internal/channel/telegram"
"github.com/gochat/gochat/internal/model"
channelmodel "github.com/gochat/gochat/internal/model/channel"
"github.com/gochat/gochat/internal/worker"
applogger "github.com/gochat/gochat/pkg/logger"
"gorm.io/gorm"
)
@@ -55,6 +56,13 @@ func NewTelegramWebhookHandler(
}
}
func (h *TelegramWebhookHandler) WithWorkerPool(wp *worker.WorkerPool) *TelegramWebhookHandler {
if h != nil && h.persister != nil {
h.persister.SetWorkerPool(wp)
}
return h
}
// HandleTelegramWebhook processes an incoming Telegram webhook Gin request.
// URL pattern: /webhooks/telegram/:bot_token
// Method: POST