mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-01-26 18:12:47 +08:00
✨ 添加昵称长度限制,更新配置和示例文件以支持该功能
This commit is contained in:
parent
c8dd126042
commit
b417a5c8d0
@ -222,6 +222,10 @@ async def nickname(event: Event, name=None):
|
|||||||
await set_nickname(user_id, "")
|
await set_nickname(user_id, "")
|
||||||
await nickname_cmd.finish("已重置昵称")
|
await nickname_cmd.finish("已重置昵称")
|
||||||
else:
|
else:
|
||||||
|
if len(name) > config.marshoai_nickname_limit:
|
||||||
|
await nickname_cmd.finish(
|
||||||
|
"昵称超出长度限制:" + str(config.marshoai_nickname_limit)
|
||||||
|
)
|
||||||
await set_nickname(user_id, name)
|
await set_nickname(user_id, name)
|
||||||
await nickname_cmd.finish("已设置昵称为:" + name)
|
await nickname_cmd.finish("已设置昵称为:" + name)
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ class ConfigModel(BaseModel):
|
|||||||
marshoai_temperature: float | None = None
|
marshoai_temperature: float | None = None
|
||||||
marshoai_max_tokens: int | None = None
|
marshoai_max_tokens: int | None = None
|
||||||
marshoai_top_p: float | None = None
|
marshoai_top_p: float | None = None
|
||||||
|
marshoai_nickname_limit: int = 16
|
||||||
marshoai_additional_image_models: list = []
|
marshoai_additional_image_models: list = []
|
||||||
marshoai_tencent_secretid: str | None = None
|
marshoai_tencent_secretid: str | None = None
|
||||||
marshoai_tencent_secretkey: str | None = None
|
marshoai_tencent_secretkey: str | None = None
|
||||||
|
@ -42,6 +42,8 @@ marshoai_enable_plugins: true # 是否启用插件功能。
|
|||||||
|
|
||||||
marshoai_load_builtin_tools: true # 是否加载内置工具。
|
marshoai_load_builtin_tools: true # 是否加载内置工具。
|
||||||
|
|
||||||
|
marshoai_nickname_limit: 16 # 昵称长度限制。
|
||||||
|
|
||||||
marshoai_toolset_dir: [] # 工具集路径。
|
marshoai_toolset_dir: [] # 工具集路径。
|
||||||
|
|
||||||
marshoai_disabled_toolkits: [] # 已禁用的工具包列表。
|
marshoai_disabled_toolkits: [] # 已禁用的工具包列表。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user