添加 /skill list 命令查看技能列表
This commit is contained in:
44
src/index.js
44
src/index.js
@@ -105,6 +105,8 @@ async function handleMessage(event) {
|
|||||||
await handleProfileCommandV2(messageData, messageContent, feishu);
|
await handleProfileCommandV2(messageData, messageContent, feishu);
|
||||||
} else if (text.startsWith('/help') || text.startsWith('/qh')) {
|
} else if (text.startsWith('/help') || text.startsWith('/qh')) {
|
||||||
await handleHelpCommandV2(chatId, feishu);
|
await handleHelpCommandV2(chatId, feishu);
|
||||||
|
} else if (text.startsWith('/skill')) {
|
||||||
|
await handleSkillCommandV2(chatId, feishu, text);
|
||||||
} else if (messageType === 'file' || messageContent.file_key) {
|
} else if (messageType === 'file' || messageContent.file_key) {
|
||||||
// 收到文件,显示配置选择
|
// 收到文件,显示配置选择
|
||||||
await handleFileReceived(messageData, feishu, uploader);
|
await handleFileReceived(messageData, feishu, uploader);
|
||||||
@@ -708,6 +710,48 @@ async function handleHelpCommandV2(chatId, feishu) {
|
|||||||
await feishu.sendCard(chatId, helpCard);
|
await feishu.sendCard(chatId, helpCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleSkillCommandV2(chatId, feishu, text) {
|
||||||
|
const args = text.replace(/^\/skill\s*/i, '').trim().split(/\s+/);
|
||||||
|
const subCommand = args[0];
|
||||||
|
|
||||||
|
if (subCommand === 'list' || !subCommand) {
|
||||||
|
const skillCard = {
|
||||||
|
config: { wide_screen_mode: true },
|
||||||
|
header: {
|
||||||
|
template: 'blue',
|
||||||
|
title: { content: '🔧 可用技能列表', tag: 'plain_text' }
|
||||||
|
},
|
||||||
|
elements: [
|
||||||
|
{
|
||||||
|
tag: 'div',
|
||||||
|
text: {
|
||||||
|
tag: 'lark_md',
|
||||||
|
content: '**📦 七牛云上传** `qiniu-uploader`\n\n七牛云文件上传和管理。支持命令触发和飞书卡片交互。\n\n**命令:**\n• `/upload` - 上传文件\n• `/qiniu-config` - 管理配置\n• `/qiniu-help` - 查看帮助'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ tag: 'hr' },
|
||||||
|
{
|
||||||
|
tag: 'div',
|
||||||
|
text: {
|
||||||
|
tag: 'lark_md',
|
||||||
|
content: '**🔍 搜索工具** `searxng`\n\n隐私保护的元搜索引擎。使用本地 SearXNG 实例搜索。\n\n**命令:**\n• `/search` - 搜索内容\n• `/image` - 搜索图片'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ tag: 'hr' },
|
||||||
|
{
|
||||||
|
tag: 'div',
|
||||||
|
text: {
|
||||||
|
tag: 'lark_md',
|
||||||
|
content: '💡 **提示:** 使用 `/skill <名称>` 查看技能详情'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
await feishu.sendCard(chatId, skillCard);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function sendWelcomeCard(chatId, feishu) {
|
async function sendWelcomeCard(chatId, feishu) {
|
||||||
const card = {
|
const card = {
|
||||||
config: { wide_screen_mode: true },
|
config: { wide_screen_mode: true },
|
||||||
|
|||||||
Reference in New Issue
Block a user