diff options
author | Giteabot <teabot@gitea.io> | 2023-08-14 08:55:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-14 08:55:17 +0800 |
commit | acc0fd22d87d6b0549ba624e4f1a760169b0624b (patch) | |
tree | 88c84cc3e80b839f7b5e3494b9ef1b97c77116bd /routers | |
parent | fe1b11b639792b601ac5ba78c0378058032ec8a8 (diff) | |
download | gitea-acc0fd22d87d6b0549ba624e4f1a760169b0624b.tar.gz gitea-acc0fd22d87d6b0549ba624e4f1a760169b0624b.zip |
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 <matikot415@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/webhook.go | 3 |
1 files changed, 2 insertions, 1 deletions
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, }, } } |