From cc961e3b4e236293f4838fbea3ff8b238092c92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A5=AD=E5=9B=A2?= Date: Fri, 6 Mar 2026 12:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=AC=A2=E8=BF=8E=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E5=92=8C=E5=B8=AE=E5=8A=A9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改: - 欢迎卡片添加帮助按钮 - 帮助信息使用卡片形式展示,更美观 - 帮助卡片包含: - 上传方式说明 - 配置命令列表 - 路径命令列表 - 使用示例 - 快捷操作按钮 --- src/index.js | 127 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 82 insertions(+), 45 deletions(-) diff --git a/src/index.js b/src/index.js index 916240d..47594d7 100644 --- a/src/index.js +++ b/src/index.js @@ -641,59 +641,48 @@ async function handleProfileCommandV2(message, content, feishu) { } async function handleHelpCommandV2(chatId, feishu) { - await feishu.sendMessage(chatId, { - msg_type: 'text', - content: { text: ` -🍙 七牛云上传 - 使用帮助 - -📤 上传方式: - -**方式 1:选择配置 → 发送文件** -1. 发送 /upload -2. 选择上传配置 -3. 发送文件 -4. 确认上传 - -**方式 2:发送文件 → 选择配置** -1. 直接发送文件 -2. 选择上传配置 -3. 确认上传 - -⚙️ 配置管理: -/config list - 查看七牛云配置 -/profile list - 查看上传配置模板 -/profile add <名称> <存储桶> [路径] - 添加上传配置 -/profile remove <名称> - 删除上传配置 - -📁 路径管理: -/path list - 查看预设路径 -/path add <名称> <路径> - 添加预设路径 - -💡 示例: -/profile add IPA 上传 default /ipa/ -/profile add 备份 default /backup/ -/profile list -/profile remove 备份 - -**提示:** -- 上传同名文件会自动覆盖 -` } - }); -} - -async function sendWelcomeCard(chatId, feishu) { - const card = { + const helpCard = { config: { wide_screen_mode: true }, header: { - template: 'blue', - title: { content: '🍙 七牛云上传机器人', tag: 'plain_text' } + template: 'green', + title: { content: '❓ 使用帮助', tag: 'plain_text' } }, elements: [ { tag: 'div', text: { tag: 'lark_md', - content: '你好!我是七牛云上传机器人。\n\n**使用方式:**\n• /upload - 选择配置上传\n• 直接发送文件\n\n**命令:**\n• /config - 配置\n• /path - 路径\n• /help - 帮助' + content: '**🍙 七牛云上传机器人**\n快速上传文件到七牛云存储' + } + }, + { + tag: 'hr' + }, + { + tag: 'div', + text: { + tag: 'lark_md', + content: '**📤 上传方式**\n\n**方式 1:选择配置 → 发送文件**\n1️⃣ 发送 /upload\n2️⃣ 选择上传配置\n3️⃣ 发送文件\n4️⃣ 确认上传\n\n**方式 2:发送文件 → 选择配置**\n1️⃣ 直接发送文件\n2️⃣ 选择上传配置\n3️⃣ 确认上传' + } + }, + { + tag: 'hr' + }, + { + tag: 'div', + text: { + tag: 'lark_md', + content: '**⚙️ 配置命令**\n\n• /config list - 查看存储桶\n• /profile list - 查看上传配置\n• /profile add <名称> <桶> [路径] - 添加配置\n• /profile remove <名称> - 删除配置\n\n**📁 路径命令**\n\n• /path list - 查看预设路径\n• /path add <名称> <路径> - 添加路径' + } + }, + { + tag: 'hr' + }, + { + tag: 'div', + text: { + tag: 'lark_md', + content: '**💡 示例**\n\n`/profile add IPA 上传 default ipa`\n`/path add backup /backup/`\n\n**提示:** 上传同名文件会自动覆盖' } }, { @@ -715,6 +704,54 @@ async function sendWelcomeCard(chatId, feishu) { } ] }; + + await feishu.sendCard(chatId, helpCard); +} + +async function sendWelcomeCard(chatId, feishu) { + const card = { + config: { wide_screen_mode: true }, + header: { + template: 'blue', + title: { content: '🍙 七牛云上传机器人', tag: 'plain_text' } + }, + elements: [ + { + tag: 'div', + text: { + tag: 'lark_md', + content: '你好!我是七牛云上传机器人,帮你快速上传文件到七牛云。\n\n**📤 上传方式:**\n• 发送 /upload 选择配置\n• 直接发送文件\n\n**⚙️ 常用命令:**\n• /config - 查看存储桶配置\n• /path - 管理预设路径\n• /profile - 管理上传配置' + } + }, + { + tag: 'action', + actions: [ + { + tag: 'button', + text: { tag: 'plain_text', content: '📤 上传文件' }, + type: 'primary', + value: { action: 'start_upload' } + }, + { + tag: 'button', + text: { tag: 'plain_text', content: '❓ 帮助' }, + type: 'default', + value: { action: 'help' } + } + ] + }, + { + tag: 'hr' + }, + { + tag: 'div', + text: { + tag: 'lark_md', + content: '💡 **提示:** 点击"帮助"查看详细使用指南' + } + } + ] + }; await feishu.sendCard(chatId, card); }