fix: clarify Telegram sender ID setup order

Explain in Chinese and English that sender IDs can be left blank while enabling and saving the channel. Guide users to retrieve their own numeric ID with /whoami and save again, and distinguish connection testing from message receiving.

Validation: 60 related tests, typecheck, lint and diff checks passed before submission.

Release note: Telegram setup now explains how to connect before obtaining your sender ID, avoiding confusion about which configuration step comes first.
This commit is contained in:
mesalogo
2026-10-05 10:35:19 +08:00
parent bbf24c282a
commit b4df493be7
3 changed files with 8 additions and 6 deletions
@@ -39,6 +39,8 @@ Manager 通过 `{ channel, status }` 增量 IPC 推送状态,忽略旧服务
Renderer 的 `channel-status-store.ts` 订阅事件,selector 只向状态区域提供对应通道数据。首次快照不会覆盖已收到的较新事件;状态更新不重新加载整份设置,不重置 Token 或白名单草稿。配置页复用共享页签、开关、项目设置字段和通知控件。
首次配置说明、空白名单提示和发送者 ID 字段帮助均明确:ID 可先留空,先启用并保存通道,连接后私聊自己的 Bot 发送 `/whoami`,取得本人数字用户 ID 后填入并再次保存。仅测试连接不启动消息接收;用户名和 Bot ID 不能代替发送者 ID。白名单为空时仍只提供帮助,不接受 AI 请求。
保存时读取状态 store 的最新值。Telegram 已启用、配置可编辑且状态为 `error` 或 `stopped` 时,即使字段未变,也提交当前配置以重启连接;`running`、`starting` 状态下的无修改保存不重启轮询。环境变量配置仍为只读,测试连接不改变轮询状态。
源码入口:[`telegram-channel-driver.ts`](../../../src/main/channels/telegram-channel-driver.ts)、[`channel-manager.ts`](../../../src/main/channels/channel-manager.ts)、[`channel-service.ts`](../../../src/main/channels/channel-service.ts)、[`channel-settings-store.ts`](../../../src/main/channels/channel-settings-store.ts)、[`channel-status-store.ts`](../../../src/renderer/src/channel-status-store.ts)、[`ChannelSettingsSection.tsx`](../../../src/renderer/src/ChannelSettingsSection.tsx)。
@@ -99,13 +99,13 @@ export const integrations = {
telegram: {
unconfigured: 'Not configured',
botFather: 'Open official BotFather',
setup: 'Send /newbot to BotFather and enter the Token here. Test, enable and save the channel, then open a private chat with your Bot. You must send /start first, then /whoami to get your numeric user ID. Add that ID below and save again.',
setup: 'Send /newbot to BotFather and enter the Token here. Leave sender IDs blank for now, enable and save the channel, and wait for it to connect. Then open a private chat with your Bot and send /start and /whoami to get your numeric user ID. Enter that ID below and save again. Testing the connection alone does not start receiving messages.',
access: 'Private text messages only. Allowed users can request operations using this project\'s working directory, Runtime and enabled tools.',
connectionHelp: 'Connection and offline messages',
network: 'GoodBuddy must stay running. Telegram follows the operating system proxy settings; configure your system proxy if needed, then test this connection. Browser access alone does not verify the channel. Use this Bot with only one GoodBuddy instance and remove any existing webhook at its source.',
offline: 'Re-enabling may process pending messages retained by Telegram for up to 24 hours, including tool requests. Interrupted tasks do not automatically resume after a crash. Check desktop task records and actual results before resending.',
noUsers: 'No users authorized. With the channel enabled and saved, /start and /whoami provide setup help only; business requests are not processed.',
sendersHelp: 'Enter numeric Telegram user IDs, one per line or separated by commas (up to 100). Usernames do not grant access.',
noUsers: 'No users authorized. You can leave this blank, enable and save the channel. Once connected, /start and /whoami provide setup help. Add your ID and save again before sending AI requests.',
sendersHelp: 'Leave blank during initial setup. Enable and save the channel, then send /whoami in a private chat with your Bot to get your numeric user ID. Enter it here and save again. Use one ID per line or separate them with commas (up to 100); do not enter @usernames or the Bot ID.',
invalidSenders: 'Enter up to 100 positive numeric user IDs (at most 256 digits each), not @usernames.',
keepToken: 'Leave blank to keep the saved Token',
enterToken: 'Enter the BotFather Token',
@@ -90,13 +90,13 @@ export const integrations = {
telegram: {
unconfigured: '未配置',
botFather: '打开官方 BotFather',
setup: '向 BotFather 发送 /newbot,将获得的 Token 填入下方。测试后启用并保存通道,再打开与 Bot 的私聊。必须先由你发送 /start,再发送 /whoami 获取自己的数字用户 ID;将 ID 填入白名单后再次保存。',
setup: '向 BotFather 发送 /newbot,将获得的 Token 填入下方。发送者 ID 可先留空,启用并保存通道,等待连接成功。然后打开与你的 Bot 的私聊,发送 /start 和 /whoami 获取自己的数字用户 ID,填回下方并再次保存。仅测试连接不会开始接收消息。',
access: '仅支持普通私聊文字。白名单内的用户可以使用此项目的工作目录、Runtime 和已启用工具发起操作。',
connectionHelp: '连接与离线消息说明',
network: 'GoodBuddy 需要保持运行。Telegram 使用操作系统代理设置;如有需要,请配置系统代理后测试连接。浏览器能够访问不代表通道可用。同一 Bot 仅供一个 GoodBuddy 实例使用,已有 webhook 需在原接入处解除。',
offline: '重新启用后可能处理 Telegram 保留的离线消息,包括工具请求;平台最多保留 24 小时。应用异常退出后不会自动续跑中断任务,请先核对桌面任务记录和实际结果,再决定是否重发。',
noUsers: '尚未授权用户。启用并保存后,/start 和 /whoami 仅提供配置帮助,不处理业务请求。',
sendersHelp: '填写 Telegram 数字用户 ID,每行一个或用逗号分隔,最多 100 个;用户名不能用于授权。',
noUsers: '尚未授权用户,可先留空保存并启用。连接后可发送 /start 和 /whoami 获取配置帮助;填入自己的 ID 并再次保存后,才能发送 AI 请求。',
sendersHelp: '首次配置可留空。先启用并保存通道,再私聊你的 Bot 发送 /whoami 获取自己的数字用户 ID,填入后再次保存。每行一个或用逗号分隔,最多 100 个;不要填写 @用户名或 Bot ID。',
invalidSenders: '请填写正整数用户 ID,最多 100 个,每个不超过 256 位,不要填写 @用户名。',
keepToken: '留空以保留已保存的 Token',
enterToken: '请输入 BotFather 提供的 Token',