Skip to content

Commit f9dd3fa

Browse files
committed
📝 update README.md
1 parent ce974d4 commit f9dd3fa

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,28 @@ load_plugin("::auto_reload", {"watch_dirs": ["plugins"]})
7373

7474
app = Entari(WS(port=5140, path="satori"))
7575
app.run()
76-
```
76+
```
77+
78+
使用配置文件:
79+
```yaml
80+
# config.yml
81+
basic:
82+
network:
83+
- type: ws
84+
port: 5140
85+
path: satori
86+
plugins:
87+
example_plugin: true
88+
::echo: true
89+
::auto_reload: true
90+
plugin:
91+
auto_reload:
92+
watch_dirs: ["plugins"]
93+
```
94+
95+
```python
96+
from arclet.entari import Entari
97+
98+
app = Entari.load("config.yml")
99+
app.run()
100+
```

arclet/entari/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def from_config(cls, config: EntariConfig | None = None):
5555
ignore_self_message = config.basic.get("ignore_self_message", True)
5656
configs = []
5757
for conf in config.basic.get("network", []):
58-
if conf["type"] == "websocket":
58+
if conf["type"] in ("websocket", "websockets", "ws"):
5959
configs.append(WebsocketsInfo(**{k: v for k, v in conf.items() if k != "type"}))
60-
elif conf["type"] == "webhook":
60+
elif conf["type"] in ("webhook", "wh", "http"):
6161
configs.append(WebhookInfo(**{k: v for k, v in conf.items() if k != "type"}))
6262
for plug, enable in config.basic.get("plugins", {}).items():
6363
if enable:

0 commit comments

Comments
 (0)