mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
feat(webhook): support Telegram Bot API 10.1 Rich Messages (#38298)
Upgrades Gitea's Telegram webhook integration to support Telegram Bot API 10.1 (June 2026 release). This enables Gitea webhooks to take advantage of rich formatted messages (tables, nested blocks, collapsible details, etc.) by routing them through the /sendRichMessage endpoint with the new rich_message payload structure. Old `/sendMessage` webhook URLs are written to `/sendRichMessage` at runtime to prevent the need for database migrations Fixes https://github.com/go-gitea/gitea/issues/38118 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
c6184ed184
commit
b09920a537
@@ -429,7 +429,7 @@ 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&message_thread_id=%s", url.PathEscape(form.BotToken), url.QueryEscape(form.ChatID), url.QueryEscape(form.ThreadID)),
|
||||
URL: fmt.Sprintf("https://api.telegram.org/bot%s/sendRichMessage?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{
|
||||
|
||||
Reference in New Issue
Block a user