feat(feishu): add group message permission authorization

This commit is contained in:
xmanrui 2026-08-22 02:29:59 +08:00
parent 7b892c02f5
commit 7bf12628ce
17 changed files with 1581 additions and 258 deletions

View file

@ -70,10 +70,22 @@ const EN = Object.freeze({
'飞书机器人设置': 'Feishu bot settings',
'群聊响应方式': 'Group response mode',
'仅在 @机器人时响应(推荐)': 'Only respond when @mentioned (recommended)',
'响应所有群消息': 'Respond to all group messages',
'响应所有群消息(需飞书敏感权限)': 'Respond to all group messages (requires a sensitive Feishu scope)',
'重新授权': 'Reauthorize',
'去授权': 'Authorize',
'重新授权群消息权限': 'Reauthorize group-message permission',
'授权群消息权限': 'Authorize group-message permission',
'正在准备授权…': 'Preparing authorization…',
'正在准备…': 'Preparing…',
'私聊始终响应;群聊仅处理明确 @当前机器人的消息。群消息权限已开通,再次切换无需授权。': 'Direct messages always work; group chats require an explicit @mention of this bot. The group-message permission is already granted, so switching again needs no authorization.',
'私聊始终响应;群聊仅处理明确 @当前机器人的消息。选择全部消息后会打开飞书官方授权流程。': 'Direct messages always work; group chats require an explicit @mention of this bot. Selecting all messages opens the official Feishu authorization flow.',
'已开通“获取群组中所有消息”权限(im:message.group_msg);机器人会处理群聊中的所有可见消息。': 'The “Read all messages in associated group chat” scope (im:message.group_msg) is granted; the bot processes every visible group message.',
'尚未确认“获取群组中所有消息”权限,请完成飞书授权。': 'The “Read all messages in associated group chat” scope has not been confirmed. Complete Feishu authorization.',
'私聊始终响应;群聊仅处理明确 @当前机器人的消息。': 'Direct messages always work; group chats require an explicit @mention of this bot.',
'需在飞书为该机器人开通“获取群组中所有消息”权限(im:message.group_msg);开通后,机器人会处理群聊中的所有可见消息。': 'Grant this bot the “Read all messages in associated group chat” Feishu scope (im:message.group_msg); once granted, it will process every visible group message.',
'群聊响应方式修改失败,请重试。': 'Could not update the group response mode. Try again.',
'群消息权限授权失败,请重试。': 'Could not authorize group-message permission. Try again.',
'钉钉设置': 'DingTalk settings',
'企业微信设置': 'WeCom settings',
'扫码接入机器人': 'Scan QR code',
@ -196,6 +208,7 @@ const EN = Object.freeze({
'生成 QQ 二维码': 'Generate QQ QR code',
'正在生成二维码…': 'Generating QR code…',
'正在准备授权二维码': 'Preparing authorization QR code',
'正在准备权限授权二维码': 'Preparing permission authorization QR code',
'正在准备微信二维码': 'Preparing WeChat QR code',
'正在添加新机器人': 'Adding a new bot',
'正在申请钉钉授权二维码…': 'Requesting DingTalk authorization QR code…',
@ -213,6 +226,16 @@ const EN = Object.freeze({
'在飞书中打开': 'Open in Feishu',
'取消添加': 'Cancel',
'使用飞书扫码修复卡片按钮': 'Scan with Feishu to repair card buttons',
'使用飞书确认群消息权限': 'Confirm group-message permission with Feishu',
'扫码会更新现有飞书应用,只增量开通“获取群组中所有消息”权限;不会创建新应用。确认后会自动启用“响应所有群消息”,其他机器人不受影响。': 'Scanning updates the existing Feishu app with only the “Read all messages in associated group chat” scope. It does not create a new app. After confirmation, “Respond to all group messages” is enabled automatically; other bots are unaffected.',
'核对现有应用,并确认“获取群组中所有消息”权限': 'Review the existing app and confirm the “Read all messages in associated group chat” permission',
'保持本页打开,等待权限生效并自动切换响应方式': 'Keep this page open while the permission takes effect and the response mode switches automatically',
'取消授权': 'Cancel authorization',
'已确认,正在启用全部消息模式': 'Confirmed. Enabling all-message mode',
'权限配置已提交,正在保存设置并重连此机器人;此阶段无法取消,其他机器人不会中断。': 'The permission update was submitted. Saving the setting and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.',
'权限配置已提交,正在启用全部消息模式并重连此机器人;此阶段无法取消,其他机器人不会中断。': 'The permission update was submitted. Enabling all-message mode and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.',
'正在为现有飞书应用申请群消息权限二维码,请稍候。': 'Requesting a group-message permission QR code for the existing Feishu app…',
'群消息权限没有开通完成': 'Group-message permission was not granted',
'扫码会更新现有飞书应用,只增量补充卡片按钮回调;不会创建新应用。确认后此机器人会短暂重连,其他机器人不受影响。': 'Scanning updates the existing Feishu app with only the card-button callback. It does not create a new app. This bot reconnects briefly after confirmation; other bots are not affected.',
'核对现有应用名称,并确认只新增卡片回调': 'Review the existing app name and confirm that only the card callback is added',
'保持本页打开,等待卡片按钮修复完成': 'Keep this page open until card-button repair finishes',
@ -225,14 +248,25 @@ const EN = Object.freeze({
'修复卡片按钮': 'Repair card buttons',
'等待扫码…': 'Waiting for scan…',
'飞书服务返回了不匹配的卡片修复二维码': 'Feishu returned a repair QR code for a different bot',
'飞书服务返回了不匹配的群消息权限二维码': 'Feishu returned a group-message permission QR code for a different bot',
'飞书服务返回的修复信息缺少 botId': 'Feishu repair status is missing the bot ID',
'飞书服务返回的应用更新信息缺少 botId': 'Feishu app-update status is missing the bot ID',
'飞书服务返回了不匹配的注册进度': 'Feishu returned registration progress for a different operation',
'此机器人': 'this bot',
'用于为${botName}开通群消息权限的一次性授权二维码': 'One-time QR code for granting group-message permission to ${botName}',
'正在为「${botName}」开通群消息权限': 'Granting group-message permission to “${botName}”',
'${botName ?? "机器人"}的修复二维码已生成,请使用飞书扫码。': 'Repair QR code generated for ${botName ?? "bot"}. Scan it with Feishu.',
'${botName ?? "机器人"}的群消息权限二维码已生成,请使用飞书确认。': 'Group-message permission QR code generated for ${botName ?? "bot"}. Confirm it with Feishu.',
'${targetBotName}已开通群消息权限,并启用“响应所有群消息”。': '${targetBotName} now has group-message permission and “Respond to all group messages” is enabled.',
'${targetBot.bot.name}已开通群消息权限,并启用“响应所有群消息”。': '${targetBot.bot.name} now has group-message permission and “Respond to all group messages” is enabled.',
'${targetBot.bot.name}已连接,可以在飞书中开始聊天。': '${targetBot.bot.name} is connected and ready to chat in Feishu.',
'已取消卡片按钮修复。': 'Card-button repair was cancelled.',
'已取消群消息权限授权。': 'Group-message permission authorization was cancelled.',
'卡片按钮已更新,但暂时无法确认机器人连接状态': 'The card callback was updated, but the bot connection could not be confirmed yet',
'群消息权限已更新,但暂时无法确认机器人连接状态': 'The group-message permission was updated, but the bot connection could not be confirmed yet',
'飞书卡片按钮修复失败': 'Could not repair the Feishu card buttons',
'飞书群消息权限开通失败': 'Could not grant the Feishu group-message permission',
'请先完成当前飞书授权操作,再开通群消息权限。': 'Finish the current Feishu authorization before granting group-message permission.',
'已确认,正在连接新机器人': 'Confirmed. Connecting the new bot',
'正在安全保存凭据并检查新机器人的消息通道,其他机器人不会中断。': 'Saving credentials and checking the new bot connection. Existing bots will not be interrupted.',
'正在向飞书申请一次性授权二维码,请稍候。': 'Requesting a one-time authorization QR code from Feishu…',
@ -531,16 +565,26 @@ function translateDynamic(text) {
if (match) return `Remove “${match[1]}” from DeepSeek Harness?`;
match = /^从 DeepSeek Harness 移除(.+)$/.exec(text);
if (match) return `Remove ${match[1]} from DeepSeek Harness`;
match = /^(.+)的飞书授权流程$/.exec(text);
if (match) return `Feishu authorization flow for ${match[1]}`;
match = /^用于修复(.+)卡片按钮的一次性授权二维码$/.exec(text);
if (match) return `One-time QR code for repairing card buttons for ${match[1]}`;
match = /^用于为(.+)开通群消息权限的一次性授权二维码$/.exec(text);
if (match) return `One-time QR code for granting group-message permission to ${match[1]}`;
match = /^正在修复「(.+)」$/.exec(text);
if (match) return `Repairing “${match[1]}”`;
match = /^正在为「(.+)」开通群消息权限$/.exec(text);
if (match) return `Granting group-message permission to “${match[1]}”`;
match = /^修复(.+)的卡片按钮$/.exec(text);
if (match) return `Repair card buttons for ${match[1]}`;
match = /^(.+)的修复二维码已生成,请使用飞书扫码。$/.exec(text);
if (match) return `Repair QR code generated for ${match[1]}. Scan it with Feishu.`;
match = /^(.+)的群消息权限二维码已生成,请使用飞书确认。$/.exec(text);
if (match) return `Group-message permission QR code generated for ${match[1]}. Confirm it with Feishu.`;
match = /^(.+)的卡片按钮已修复。$/.exec(text);
if (match) return `Card buttons repaired for ${match[1]}.`;
match = /^(.+)已开通群消息权限,并启用“响应所有群消息”。$/.exec(text);
if (match) return `${match[1]} now has group-message permission and “Respond to all group messages” is enabled.`;
match = /^(检查连接|重试连接)(.+)$/.exec(text);
if (match) return `${localizeText(match[1])} ${match[2]}`;
match = /^移除(.+)$/.exec(text);