From df8bc01178c6df9b062e213a01a663cc88649b0c Mon Sep 17 00:00:00 2001 From: Snowykami Date: Sun, 15 Dec 2024 17:37:33 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=8F=91=E6=96=87=E6=A1=A3=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8F=92=E4=BB=B6=E5=92=8C=E5=B7=A5=E5=85=B7=E7=9A=84?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=EF=BC=9B=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9C=B0=E7=90=86=E4=BD=8D=E7=BD=AE=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=87=BD=E6=95=B0=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/dev/extension.md | 14 ++++++++++++++ .../plugins/snowykami_testplugin/__init__.py | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/zh/dev/extension.md b/docs/zh/dev/extension.md index 68865217..ee606aa7 100755 --- a/docs/zh/dev/extension.md +++ b/docs/zh/dev/extension.md @@ -3,3 +3,17 @@ order: 2 --- # 扩展开发 + +## 说明 + +扩展分为两类,一类为插件,一类为工具。 + +- 插件 +- 工具(由于开发的不便利性,已经停止维护,未来可能会放弃支持,如有需求请看README中的内容,我们不推荐再使用此功能) + +## 插件 + +插件很简单,一个Python文件,一个Python包都可以是插件,插件组成也很简单 + +- 元数据:包含插件的信息,如名称、版本、作者等 +- 实际 \ No newline at end of file diff --git a/nonebot_plugin_marshoai/plugins/snowykami_testplugin/__init__.py b/nonebot_plugin_marshoai/plugins/snowykami_testplugin/__init__.py index d851cb1d..2f972853 100644 --- a/nonebot_plugin_marshoai/plugins/snowykami_testplugin/__init__.py +++ b/nonebot_plugin_marshoai/plugins/snowykami_testplugin/__init__.py @@ -43,7 +43,7 @@ async def get_weather(location: str, days: int, unit: str) -> str: @on_function_call(description="获取设备物理地理位置") -async def get_location() -> str: +def get_location() -> str: """获取设备物理地理位置""" # 进行一系列获取地理位置操作... @@ -51,6 +51,6 @@ async def get_location() -> str: return "日本 东京都 世田谷区" -@on_function_call(description="获取聊天者个人信息") +@on_function_call(description="获取聊天者个人信息及发送的消息和function call调用参数") async def get_user_info(e: MessageEvent, c: Caller) -> str: - return f"用户信息:{e.user_id} {e.sender.nickname}, {c._parameters}" + return f"用户ID: {e.user_id} 用户昵称: {e.sender.nickname} FC调用参数:{c._parameters} 消息内容: {e.raw_message}"