Skip to content

Commit

Permalink
🐛 fix version 0.10.0rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Dec 10, 2024
1 parent 937f8de commit cf0f3f3
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,60 @@ load_plugin("::auto_reload", {"watch_dirs": ["plugins"]})
app.run()
```



## 配置文件

```yaml
basic:
network:
- type: ws
host: "127.0.0.1"
port: 5140
path: "satori"
ignore_self_message: true
log_level: INFO
prefix: ["/"]
plugins:
~record_message:
record_send: true
~commands:
use_config_prefix: false
::auto_reload:
watch_dirs: ["."]
watch_config: false
::echo: true
::help:
page_size: null
```
- `basic`: Entari 基础配置
- `network`: 网络配置, 可写多个网络配置
- `type`: 网络类型, 可填项有 `ws`, `websocket`, `wh`, `webhook`
- `host`: satori 服务器地址
- `port`: satori 服务器端口
- `path`: satori 服务器路径
- `ignore_self_message`: 是否忽略自己发送的消息事件
- `log_level`: 日志等级
- `prefix`: 指令前缀, 可留空
- `plugins`: 插件配置
- `~record_message`: 消息日志并配置
- `record_send`: 是否记录发送消息 (默认为 `true`)
- `~commands`: 指令插件配置 (适用于所有使用了 `command.on/command.command` 的插件)
- `need_notice_me`: 指令是否需要 @ 机器人
- `need_reply_me`: 指令是否需要回复机器人
- `use_config_prefix`: 是否使用配置文件中的前缀
- `::auto_reload`: 启用自动重载插件并配置
- `watch_dirs`: 监听目录
- `watch_config`: 是否监听配置文件的变化 (默认为 `true`)
- `::echo`: 启用回声插件
- `::help`: 启用帮助插件并配置
- `help_command`: 帮助指令, 默认为 `help`
- `help_alias`: 帮助指令别名, 默认为 `["帮助", "命令帮助"]`
- `page_size`: 每页显示的指令数量, 留空则不分页

对于其他插件的配置, 有三种写法:

1. `foo.bar: true` (启用插件)
2. `foo.bar: false` (禁用插件)
3. `foo.bar: {"key": "value"}` (启用插件并配置)
6 changes: 3 additions & 3 deletions arclet/entari/builtins/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from arclet.entari import Session, command, metadata, plugin_config

config = plugin_config()
help_text: str = config.get("help_text", "help")
help_command: str = config.get("help_command", "help")
help_alias: list[str] = config.get("help_alias", ["帮助", "命令帮助"])
help_all_alias: list[str] = config.get("help_all_alias", ["所有帮助", "所有命令帮助"])
page_size: Optional[int] = config.get("page_size", None)
Expand All @@ -35,7 +35,7 @@
ns.disable_builtin_options = {"shortcut"}

help_cmd = Alconna(
help_text,
help_command,
Args[
"query#选择某条命令的id或者名称查看具体帮助;/?",
str,
Expand All @@ -61,7 +61,7 @@
meta=CommandMeta(
description="显示所有命令帮助",
usage="可以使用 --hide 参数来显示隐藏命令,使用 -P 参数来显示命令所属插件名称",
example=f"${help_text} 1",
example=f"${help_command} 1",
),
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "arclet-entari"
version = "0.9.0"
version = "0.10.0rc1"
description = "Simple IM Framework based on satori-python"
authors = [
{name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"},
Expand Down

0 comments on commit cf0f3f3

Please sign in to comment.