mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-02-26 07:10:24 +08:00
新增marsho.status命令
This commit is contained in:
parent
c503228a5f
commit
ba6b02d68e
@ -72,6 +72,14 @@ marsho_help_cmd = on_alconna(
|
|||||||
priority=10,
|
priority=10,
|
||||||
block=True,
|
block=True,
|
||||||
)
|
)
|
||||||
|
marsho_status_cmd = on_alconna(
|
||||||
|
Alconna(
|
||||||
|
config.marshoai_default_name + ".status",
|
||||||
|
),
|
||||||
|
priority=10,
|
||||||
|
block=True,
|
||||||
|
)
|
||||||
|
|
||||||
marsho_at = on_message(rule=to_me() & at_enable, priority=11)
|
marsho_at = on_message(rule=to_me() & at_enable, priority=11)
|
||||||
nickname_cmd = on_alconna(
|
nickname_cmd = on_alconna(
|
||||||
Alconna(
|
Alconna(
|
||||||
@ -226,6 +234,16 @@ async def marsho_help():
|
|||||||
await marsho_help_cmd.finish(metadata.usage)
|
await marsho_help_cmd.finish(metadata.usage)
|
||||||
|
|
||||||
|
|
||||||
|
@marsho_status_cmd.handle()
|
||||||
|
async def marsho_status():
|
||||||
|
await marsho_status_cmd.finish(
|
||||||
|
f"当前使用的模型:{model_name}\n"
|
||||||
|
# f"当前会话数量:{len(target_list)}\n"
|
||||||
|
# f"当前上下文数量:{len(context.contexts)}"
|
||||||
|
f"当前支持图片的模型:{str(SUPPORT_IMAGE_MODELS + config.marshoai_additional_image_models)}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@marsho_at.handle()
|
@marsho_at.handle()
|
||||||
@marsho_cmd.handle()
|
@marsho_cmd.handle()
|
||||||
async def marsho(
|
async def marsho(
|
||||||
@ -246,7 +264,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()
|
||||||
await marsho_cmd.finish(INTRODUCTION + "\n当前使用的模型:" + model_name)
|
await marsho_cmd.finish(INTRODUCTION)
|
||||||
try:
|
try:
|
||||||
user_id = event.get_user_id()
|
user_id = event.get_user_id()
|
||||||
nicknames = await get_nicknames()
|
nicknames = await get_nicknames()
|
||||||
@ -287,7 +305,9 @@ async def marsho(
|
|||||||
) # type: ignore
|
) # type: ignore
|
||||||
) # type: ignore
|
) # type: ignore
|
||||||
elif config.marshoai_enable_support_image_tip:
|
elif config.marshoai_enable_support_image_tip:
|
||||||
await UniMessage("*此模型不支持图片处理。").send()
|
await UniMessage(
|
||||||
|
"*此模型不支持图片处理或管理员未启用此模型的图片支持。图片将被忽略。"
|
||||||
|
).send()
|
||||||
backup_context = await get_backup_context(target.id, target.private)
|
backup_context = await get_backup_context(target.id, target.private)
|
||||||
if backup_context:
|
if backup_context:
|
||||||
context.set_context(
|
context.set_context(
|
||||||
|
@ -30,6 +30,7 @@ INTRODUCTION: str = f"""MarshoAI-NoneBot by LiteyukiStudio
|
|||||||
我的主页在这里哦~↓↓↓
|
我的主页在这里哦~↓↓↓
|
||||||
https://marsho.liteyuki.icu
|
https://marsho.liteyuki.icu
|
||||||
|
|
||||||
|
※ 使用 「{config.marshoai_default_name}.status」命令获取状态信息。
|
||||||
※ 使用「{config.marshoai_default_name}.help」命令获取使用说明。"""
|
※ 使用「{config.marshoai_default_name}.help」命令获取使用说明。"""
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user