mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2026-01-17 00:01:47 +00:00
⚡ 仅对onebot适配器启用表情回应
This commit is contained in:
@@ -229,6 +229,9 @@ async def marsho(
|
||||
):
|
||||
|
||||
global target_list
|
||||
is_reaction_supported = False
|
||||
if "onebot" in bot.adapter.get_name().lower():
|
||||
is_reaction_supported = True
|
||||
if event.get_message().extract_plain_text() and (
|
||||
not text
|
||||
and event.get_message().extract_plain_text() != config.marshoai_default_name
|
||||
@@ -237,7 +240,8 @@ async def marsho(
|
||||
if not text:
|
||||
# 发送说明
|
||||
# await UniMessage(metadata.usage + "\n当前使用的模型:" + model_name).send()
|
||||
await message_reaction(Emoji("38"))
|
||||
if is_reaction_supported:
|
||||
await message_reaction(Emoji("38"))
|
||||
await marsho_cmd.finish(INTRODUCTION)
|
||||
backup_context = await get_backup_context(target.id, target.private)
|
||||
if backup_context:
|
||||
@@ -270,7 +274,8 @@ async def marsho(
|
||||
+ await get_mcp_list()
|
||||
)
|
||||
logger.info(f"正在获取回答,模型:{model_name}")
|
||||
await message_reaction(Emoji("66"))
|
||||
if is_reaction_supported:
|
||||
await message_reaction(Emoji("66"))
|
||||
# logger.info(f"上下文:{context_msg}")
|
||||
response = await handler.handle_common_chat(
|
||||
usermsg, model_name, tools_lists, config.marshoai_stream
|
||||
|
||||
@@ -44,6 +44,8 @@ plugins = ["nonebot_plugin_marshoai"]
|
||||
# 测试用
|
||||
adapters = [
|
||||
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
|
||||
{ name = "nonebot-adapter-milky", module_name = "nonebot.adapters.milky" },
|
||||
|
||||
]
|
||||
|
||||
[tool.pdm]
|
||||
|
||||
Reference in New Issue
Block a user