feat: replace N8N_BASE_URL with N8N_WEBHOOK_URL (full webhook URL)

This commit is contained in:
2026-04-16 20:47:19 +02:00
parent 0f6649931f
commit 125b039d19
21 changed files with 33 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ TELEGRAM_BOT_TOKEN=your_bot_token_here
BOT_MODE=polling BOT_MODE=polling
TELEGRAM_DEBUG=false TELEGRAM_DEBUG=false
N8N_BASE_URL=http://localhost:5678 N8N_WEBHOOK_URL=http://localhost:5678/webhook/your-webhook-id
N8N_AUTH_TOKEN= N8N_AUTH_TOKEN=
OPENAI_API_KEY=your_openai_key_here OPENAI_API_KEY=your_openai_key_here

View File

@@ -51,11 +51,10 @@ func main() {
downloader := infratelegram.NewTelegramFileDownloader(bot) downloader := infratelegram.NewTelegramFileDownloader(bot)
sessionStore := storage.NewRedisSessionStore(redisClient, cfg.Redis.TTLHours) sessionStore := storage.NewRedisSessionStore(redisClient, cfg.Redis.TTLHours)
// n8n workflows (configure via env: N8N_WORKFLOW_<INTENT>=<url>)
workflows := map[string]n8n.WorkflowConfig{ workflows := map[string]n8n.WorkflowConfig{
"default": { "default": {
ID: "default", ID: "default",
WebhookURL: cfg.N8n.BaseURL + "/webhook/default", WebhookURL: cfg.N8n.WebhookURL,
AuthToken: cfg.N8n.AuthToken, AuthToken: cfg.N8n.AuthToken,
}, },
} }

View File

@@ -23,7 +23,7 @@ type BotConfig struct {
} }
type N8nConfig struct { type N8nConfig struct {
BaseURL string `envconfig:"N8N_BASE_URL" required:"true"` WebhookURL string `envconfig:"N8N_WEBHOOK_URL" required:"true"`
AuthToken string `envconfig:"N8N_AUTH_TOKEN"` AuthToken string `envconfig:"N8N_AUTH_TOKEN"`
TimeoutSecs int `envconfig:"N8N_TIMEOUT" default:"30"` TimeoutSecs int `envconfig:"N8N_TIMEOUT" default:"30"`
RetryCount int `envconfig:"N8N_RETRY_COUNT" default:"3"` RetryCount int `envconfig:"N8N_RETRY_COUNT" default:"3"`

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:02.000
That's what she said

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:02.000
1, 2, 3, 4

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:02.000
Fazla mahsuçları...

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:02.000
Raz, dwa, trzy, cztery.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:01.000
Raz, dwa, trzy.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
WEBVTT
00:00:00.000 --> 00:00:02.000
Raz, dwa, trzy, cztery.

Binary file not shown.