Community生产力与协作github.com

publora/telegram-post

当用户希望通过机器人,通过 Publora 在 Telegram 频道或群组中发布或定时发送帖子时使用。涵盖 Telegram 的 Markdown 格式、静默发送、链接预览和转发保护。机器人 API 将媒体标题限制为 1,024 个字符,视频限制为 50 MB。不适用于其他平台(每个平台都有各自的技能)。

telegram-post 是什么?

该技能通过 Publora MCP 服务器将 AI 智能体与 Telegram 机器人发布功能连接起来。开发者可以使用由 BotFather 创建的机器人,以编程方式向 Telegram 频道和群组发布格式化的消息、图片和视频。它支持可选定时发布时间,并底层处理严格的 Bot API 限制(媒体标题最长 1,024 字符,视频最大 50 MB)。智能体可通过 MCP 工具直接调用,例如 `create_post`(支持媒体 URL 和定时)或分步工作流 `get_upload_url` + `complete_media`,此外也提供了 REST API 回退方案。它还处理纯文本与媒体类帖子的不同字符限制,并提供了一个严格的 `platformSettings` 模式来控制静默发送和链接预览等选项。该技能已在 Claude Code、Cursor、Codex 以及其他 MCP 兼容的客户端上经过测试,配置过程仅需一对 Authorization 头即可。

兼容平台✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/publora/skills/tree/main/skills/telegram-post

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Telegram 帖子

使用 Publora MCP 服务器创建并定时发布帖子到 Telegram 频道和群组。支持丰富的 Markdown 格式、图片、视频以及消息投递选项。

前提条件

套餐: 可免费使用 Starter 套餐。当前限制与定价:publora.com/pricing。

开始使用

  1. 注册账号 于 publora.com/register(免费)
  2. 创建 Telegram 机器人:
    • 在 Telegram 中向 @BotFather 发送消息
    • 发送 /newbot 并按照指示操作
    • 保存机器人 Token
  3. 将机器人添加到你的频道:
    • 将机器人添加为频道/群组的管理员
    • 授予 can_post_messages 权限
  4. 在 Publora 中连接,前往控制台,使用机器人 Token 和频道名称
  5. 获取 API 密钥 于 app.publora.com/dashboard/api
  6. 将你的智能体连接到 MCP 服务器,地址为 https://mcp.publora.com,使用 Authorization: Bearer sk_YOUR_API_KEY 进行身份验证。在 Claude Code 中:
claude mcp add publora --transport http https://mcp.publora.com \
  --header "Authorization: Bearer sk_YOUR_API_KEY"

Claude Desktop、Cursor、Codex、OpenClaw 以及 claude.ai 连接器各自需要不同的配置文件或流程:请参阅客户端设置了解准确的路径和代码片段。

REST API 回退方案

如果 MCP 服务器不可用或返回错误,可直接使用 REST API:

基础 URL: https://api.publora.com/api/v1

身份验证: 使用 x-publora-key 头(不是 Authorization: Bearer):

# 获取你已连接的平台
curl -X GET "https://api.publora.com/api/v1/platform-connections" \
  -H "x-publora-key: sk_your_api_key"

# 创建帖子
curl -X POST "https://api.publora.com/api/v1/create-post" \
  -H "x-publora-key: sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "platforms": ["telegram-1001234567890"],
    "content": "*公告*\n\n你的消息在此",
    "scheduledTime": "2026-03-25T10:00:00Z"
  }'

平台 ID 格式: telegram-{chat_id},其中 {chat_id} 是来自 /platform-connections 的频道/群组数字 ID。

示例 ID:telegram-1001234567890、telegram--1002345678901

📖 完整 API 文档: docs.publora.com

平台限制(Bot API)

功能限制
文本消息4,096 个字符
媒体标题1,024 个字符(关键限制!)
图片最大 10 MB,每个媒体组最多 10 张
图片格式JPEG、PNG、GIF、BMP、WebP
视频大小最大 50 MB(不是 4 GB——那是普通用户的!)
视频格式MP4、MOV、AVI、MKV、WebM
速率限制全局 30 条消息/秒,每个群组 20 条消息/分钟

关键点: Bot API 的限制远低于普通 Telegram 用户。超过 50 MB 的视频和超过 1,024 个字符的标题会失败。

Markdown 格式

Telegram 使用自己的 Markdown 风格,单个星号表示加粗:

语法结果
*粗体*粗体
_斜体_斜体
`代码`内联代码
代码````代码块
[文本](url)超链接
> 文本块引用

注意: 这与标准 Markdown 不同,标准 Markdown 中 **双星号** 表示加粗。

可用工具

create_post

创建新的 Telegram 帖子。

参数:

  • platforms:包含你的 Telegram 连接 ID 的数组(例如 ["telegram-1001234567890"])
  • content:消息文本(支持 Markdown)
  • scheduledTime:ISO 8601 UTC 日期时间。可选:省略则帖子创建为草稿。传入未来的时间则定时发送。如果时间早于当前时间五分钟或更多,将返回 SCHEDULED_TIME_IN_PAST 错误,因此要立即发布请使用当前时间加一分钟。
  • mediaUrls:最多 10 个公开的 https 图片或视频 URL。Publora 在服务端下载它们并在验证之前附加,因此媒体和定时通过一次调用完成。这是草稿加 get_upload_url 加 complete_media 流程的一次性替代方案。上传速率限制为每小时 60 个 URL。

get_upload_url

获取用于媒体上传的预签名 URL。

complete_media

当预签名 PUT 成功后,完成通过 get_upload_url 上传的文件。可选,因为定时也会完成待处理的媒体,但提前调用可以提前暴露格式和探测错误。对于通过 mediaUrls 附加的媒体不需要此步骤。

参数:

  • mediaId:get_upload_url 返回的 ID

list_connections

列出你已连接的账号及其平台 ID。先调用此工具并逐字复制 ID;它们永远无法猜测。

list_posts / get_post / update_post / delete_post

管理定时和草稿帖子。update_post 还可以在草稿或定时帖子中修补 content 和 platforms,因此修复拼写错误或重新定向不再需要删除和重新创建。delete_media 和 prune_media_reference 用于清理上传的文件。

帖子选项(通过 REST API)

通过 REST API 的 platformSettings.telegram 可用的 Telegram 特定选项:

选项描述
disableNotification静默发送(无声音)
disableWebPagePreview无链接预览卡片
protectContent禁止转发/保存

标题位于媒体上方不可设置:showCaptionAboveMedia 不是可接受的键,发送它会返回 400 PLATFORM_SETTING_UNKNOWN。

注意:platformSettings 在 MCP 的 create_post 和 update_post 工具以及 REST 中均可接受。该模式是严格的:拼写错误的平台或键会被验证错误拒绝,而不是静默忽略。

示例

简单频道帖子

将以下内容发布到我的 Telegram 频道:
"*产品更新 v2.5*

我们已发布以下改进:
- _更快的 API 响应时间_(平均 45 毫秒)
- 新的 `batch` 端点用于批量操作

[阅读变更日志](https://example.com/changelog)"

格式化公告

创建具有以下格式的 Telegram 帖子:
"*重要更新*

我们明天 UTC 时间上午 10:00 发布新功能。

_新内容:_
- 功能 A 改进
- 功能 B 发布

[阅读完整公告](https://example.com/update)"

带图片的帖子

将这张图片发布到我的 Telegram 频道,并附带标题:
"*全新控制面板预览*

这是重新设计的分析控制面板的抢先预览。"

重要: 当发布带媒体的帖子时,标题必须少于 1,024 个字符。

定时帖子

将此内容定时为明天莫斯科时间上午 8 点发布:
"*早安!* 这是每日市场摘要..."

重要限制

  1. 标题限制为 1,024 字符:当发布带媒体(图片/视频)的帖子时,文本作为标题发送,限制为 1,024 个字符。纯文本消息允许 4,096 个字符。

  2. 视频最大 50 MB:Bot API 将视频限制为 50 MB(而不是普通用户的 4 GB)。大视频会失败。

  3. 机器人必须是管理员:你的机器人需要管理员角色和 can_post_messages 权限。这在连接时会验证。

  4. 不允许混合媒体:单个帖子不能同时包含图片和视频。

  5. 标题溢出:如果媒体帖子的标题超过 1,024 个字符,它将作为单独的回复消息发送,而不是被截断。

最佳实践

内容

  1. 使用格式:加粗标题、斜体强调可提高可读性
  2. 链接预览:非常适合文章;对于简洁的公告请禁用
  3. 表情符号使用:在 Telegram 上常见且受欢迎
  4. 帖子长度:纯文本消息没有长度惩罚

时机

  • 全球受众:Telegram 用户遍布全球;考虑时区发帖
  • 最佳时间:目标地区的 8-10 点、12-14 点、19-21 点
  • 频率:频道可以更频繁地发帖(每天 5-10 条)

互动

  • 在频道设置中启用评论以进行讨论
  • 使用投票提高参与度
  • 置顶重要公告

故障排除

错误原因解决方案
"Bot not admin"机器人缺少管理员权限将机器人添加为管理员并授予 can_post_messages
"Channel not found"频道名称/ID 错误验证 @channelname 或数字聊天 ID
MEDIA_CAPTION_TOO_LONG标题超过 1,024 个字符缩短标题或使用纯文本帖子
"Bad Request: file is too big"文件超过 50 MB将视频/图片压缩到 50 MB 以下
"Mixed media not supported"同一帖子中包含图片和视频每个帖子仅使用一种媒体类型

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

publora/bluesky-post

Use when the user wants to post or schedule to Bluesky through Publora. Handles the 300-character cap, auto-detected hashtags and links, up to 4 images, and videos. Alt text cannot be set through the API. Needs a Bluesky app password, never the main password. Not for Mastodon (use social-post).

publora/instagram-post

Use when the user wants to post or schedule to Instagram through Publora: a single image, a 2-10 image carousel, a Reel or a Story. Requires a Business account and an image or video; text-only posts are rejected by the API. Not for Threads (use threads-post).

publora/linkedin-analytics

Analyze LinkedIn performance and manage engagement through Publora. Use when the user asks how a LinkedIn post or account performed (impressions, reach, reactions, comments, reshares, follower growth) or wants to react, comment, reshare or resolve an @mention. Statistics run over the REST API, engagement over MCP tools. Not for creating posts (use linkedin-post).

publora/linkedin-post

Use when the user wants to publish or schedule a LinkedIn post through Publora: text, a multi-image grid, a video, a PDF document, or @mentions. Not for analytics, reactions, comments or reshares (use linkedin-analytics), and not for other platforms.

publora/social-post

Use when the user wants to post or schedule to YouTube, a Facebook Page or Mastodon through Publora. YouTube needs a video on every post, Facebook publishes to Pages only, Mastodon caps at 500 characters. Not for the platforms that have their own skill.

publora/threads-post

Create and schedule Threads posts with image carousels and reply control via Publora MCP. Use when the user wants to post to Meta's Threads. Multi-part threading is currently disabled by the platform, so long content stays a single post. Not for Instagram (use instagram-post) or X threads (use x-post).

publora/tiktok-post

Use when the user wants to upload or schedule a TikTok video through Publora, with privacy, comment, duet, stitch and commercial-disclosure settings. Video runs 3 seconds to 10 minutes at 23+ FPS; carousels take up to 35 images. Unaudited apps can publish private videos only. Not for Reels (use instagram-post).

publora/x-post

Use when the user wants to post or schedule to X (Twitter) through Publora, including threads auto-split past 280 characters, up to 4 images, or a video up to 140 seconds. X needs a paid Publora plan. Not for Threads or Bluesky (each has its own skill).

相关技能