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