mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 00:02:43 +02: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:
1 parent
c6184ed184
commit
b09920a537
3 files changed
+41
-29
No files matched your search
@@ -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