File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -73,4 +73,28 @@ load_plugin("::auto_reload", {"watch_dirs": ["plugins"]})
73
73
74
74
app = Entari(WS(port = 5140 , path = " satori" ))
75
75
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
+ ```
Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ def from_config(cls, config: EntariConfig | None = None):
55
55
ignore_self_message = config .basic .get ("ignore_self_message" , True )
56
56
configs = []
57
57
for conf in config .basic .get ("network" , []):
58
- if conf ["type" ] == "websocket" :
58
+ if conf ["type" ] in ( "websocket" , "websockets" , "ws" ) :
59
59
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" ) :
61
61
configs .append (WebhookInfo (** {k : v for k , v in conf .items () if k != "type" }))
62
62
for plug , enable in config .basic .get ("plugins" , {}).items ():
63
63
if enable :
You can’t perform that action at this time.
0 commit comments