From acc0fd22d87d6b0549ba624e4f1a760169b0624b Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 14 Aug 2023 08:55:17 +0800 Subject: Add ThreadID parameter for Telegram webhooks (#25996) (#26480) Backport #25996 Telegram has recently implemented threads (channels) for group chats. Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: neveraskedtoexist --- routers/web/repo/webhook.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'routers') diff --git a/routers/web/repo/webhook.go b/routers/web/repo/webhook.go index c3362cb00a..7135d3323c 100644 --- a/routers/web/repo/webhook.go +++ b/routers/web/repo/webhook.go @@ -425,12 +425,13 @@ func telegramHookParams(ctx *context.Context) webhookParams { return webhookParams{ Type: webhook_module.TELEGRAM, - URL: fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s", url.PathEscape(form.BotToken), url.QueryEscape(form.ChatID)), + URL: fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s&message_thread_id=%s", url.PathEscape(form.BotToken), url.QueryEscape(form.ChatID), url.QueryEscape(form.ThreadID)), ContentType: webhook.ContentTypeJSON, WebhookForm: form.WebhookForm, Meta: &webhook_service.TelegramMeta{ BotToken: form.BotToken, ChatID: form.ChatID, + ThreadID: form.ThreadID, }, } } -- cgit v1.2.3