feat(lark_mcp): 更新飞书卡片消息发送工具以支持单接收者

- 将send_card_message工具从接收ID列表改为单个接收者ID
- 修复test.py中导入并调用send_card_message的测试逻辑
- 新增机器人充电、终止任务、通知播放功能
- 扩展迎宾和巡逻功能参数,提供默认值和更灵活的配置
- 更新项目版本号至0.1.13和0.1.9
This commit is contained in:
2026-03-19 10:32:09 +08:00
parent 3d04166314
commit 894ee1dfbf
6 changed files with 135 additions and 50 deletions

View File

@@ -35,7 +35,7 @@ def main() -> None:
mcp_module.types = types_module
sys.modules["mcp"] = mcp_module
sys.modules["mcp.types"] = types_module
from lzwcai_lark_mcp.tools import send_stranger_card
from lzwcai_lark_mcp.tools import send_card_message, send_stranger_card
app_id = os.getenv("app_id", "")
app_secret = os.getenv("app_secret", "")
auth_url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
@@ -53,6 +53,18 @@ def main() -> None:
if not token:
raise RuntimeError(f"lark auth response missing token: {data}")
user_id = "gegg1d78"
receiver_id = os.getenv("receiver_id", user_id)
person_id = os.getenv("person_id", "")
image_key = os.getenv("image_key", "").strip()
if not image_key:
raise RuntimeError("missing image_key")
card_message_id = send_card_message(
token,
receiver_id,
person_id,
image_key
)
print(card_message_id)
result = send_stranger_card(
token,
user_id,