2024-09-01 22:15:01 +08:00
import { _ as s , c as i , o as a , a9 as n } from "./chunks/framework.C4_mTacX.js" ; const y = JSON . parse ( '{"title":"liteyuki.bot","description":"","frontmatter":{"title":"liteyuki.bot","collapsed":true},"headers":[],"relativePath":"dev/api/bot/bot.md","filePath":"zh/dev/api/bot/bot.md","lastUpdated":null}' ) , t = { name : "dev/api/bot/bot.md" } , l = n ( ` <h1 id="liteyuki-bot" tabindex="-1">liteyuki.bot <a class="header-anchor" href="#liteyuki-bot" aria-label="Permalink to "liteyuki.bot""> </a></h1><h3 id="class-liteyukibot" tabindex="-1"><em><strong>class</strong></em> <code>LiteyukiBot</code> <a class="header-anchor" href="#class-liteyukibot" aria-label="Permalink to "***class*** \` LiteyukiBot \` ""> </a></h3><h4 id="func-init-self-kwargs-none" tabindex="-1"><em><strong>func</strong></em> <code>__init__(self, **kwargs) -> None</code> <a class="header-anchor" href="#func-init-self-kwargs-none" aria-label="Permalink to "***func*** \` __init__(self, **kwargs) -> None \` ""> </a></h4><p><strong>说明</strong>: 初始化轻雪实例</p><p><strong>参数</strong>:</p><blockquote><ul><li>**kwargs: 配置</li></ul></blockquote><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/bot/__init__.py#L27" target="_blank">在GitHub上查看</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> __init__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(self, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">**</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">kwargs) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">None</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 初始化轻雪实例 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > * * kwargs : 配置 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 常规操作 & # 39 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > print _logo ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > global < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > _ B O T _ I N S T A N C E < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > _BOT _INSTANCE < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 配置 & # 39 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c o n f i g : d i c t [ < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s t r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > , A n y ] < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > k w a r g s < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 初始化 & # 39 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . i n i t ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > * * < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c o n f i g ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . info ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; L i t e y u k i i s i n i t i a l i z i n g . . . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 生命周期管理 & # 39 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > L i f e s p a n ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . p r o c e s s _ m a n a g e r : P r o c e s s M a n a g e r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > P r o c e s s M a n a g e r ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > l i f e s p a n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 事件循环 & # 39 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l o o p < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > a s y n c i o . n e w _ e v e n t _ l o o p ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > asyncio . set _event _loop ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l o o p ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . s t o p _ e v e n t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > t h r e a d i n g . E v e n t ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c a l l _ r e s t a r t _ c o u n t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 0 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & # 39 ; 加载插件加载器 & # 39 ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > load _plugin ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; l i t e y u k i . p l u g i n s . p l u g i n _ l o a d e r & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - r u n - s e l f " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > r u n ( s e l f ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - r u n - s e l f " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` r u n ( s e l f ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 外 部 启 动 接 口 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 6 6 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > r u n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 外部启动接口 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . p r o c e s s _ m a n a g e r . s t a r t _ a l l ( ) < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > try < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > asyncio . run ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . _ r u n ( ) ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > except < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > K e y b o a r d I n t e r r u p t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . opt ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > c o l o r s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > T r u e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) . i n f o ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; & l t ; y & g t ; L i t e y u k i i s s t o p p i n g . . . & l t ; / y & g t ; & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . s t o p ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . opt ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > c o l o r s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > T r u e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) . i n f o ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; & l t ; y & g t ; L i t e y u k i i s s t o p p e d . . . & l t ; / y & g t ; & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " a s y n c - f u n c - k e e p - a l i v e - s e l f " t a b i n d e x = " - 1 " > < e m > < s t r o n g > a s y n c f u n c < / s t r o n g > < / e m > < c o d e > k e e p _ a l i v e ( s e l f ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # a s y n c - f u n c - k e e p - a l i v e - s e l f " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * a s y n c f u n c * * * \ ` k e e p _ a l i v e ( s e l f ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 保 持 轻 雪 运 行 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 7 8 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > a s y n c < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > k e e p _ a l i v e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 保持轻雪运行 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . info ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; L i t e y u k i i s k e e p i n g a l i v e . . . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > try < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > while < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > n o t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . s t o p _ e v e n t . i s _ s e t ( ) : < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > await < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > a s y n c i o . s l e e p ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 0 . 1 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > except < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > E x c e p t i o n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . info ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; L i t e y u k i i s e x i t i n g . . . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . s t o p ( ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - r e s t a r t - s e l f - d e l a y - i n t - 0 " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > r e s t a r t ( s e l f , d e l a y : i n t = 0 ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - r e s t a r t - s e l f - d e l a y - i n t - 0 " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` r e s t a r t ( s e l f , d e l a y : i n t = 0 ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 重 启 轻 雪 本 体 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > d e l a y ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / f u n c t i o n s . h t m l # i n t " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > i n t < / c o d e > < / a > , o p t i o n a l ) : 延 迟 重 启 时 间 . D e f a u l t s t o 0 . < / l i > < / u l > < / b l o c k q u o t e > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 9 0 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > r e s t a r t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , d e l a y : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > i n t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 0 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 重启轻雪本体 < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > delay ( [ \ ` int \` ](https%3A//docs.python.org/3/library/functions.html#int), optional): 延迟重启时间. Defaults to 0.</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c a l l _ r e s t a r t _ c o u n t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > & l t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 1 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > executable < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > s y s . e x e c u t a b l e < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > s y s . a r g v < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . info ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; R e s t a r t i n g L i t e y u k i B o t . . . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > time . sleep ( delay ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > p l a t f o r m . s y s t e m ( ) < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; W i n d o w s & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > cmd < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; s t a r t & # 3 9 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > p l a t f o r m . s y s t e m ( ) < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; L i n u x & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > cmd < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; n o h u p & # 3 9 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > p l a t f o r m . s y s t e m ( ) < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; D a r w i n & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > cmd < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; o p e n & # 3 9 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > cmd < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; n o h u p & # 3 9 ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . p r o c e s s _ m a n a g e r . t e r m i n a t e _ a l l ( ) < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > threading . Thread ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > t a r g e t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > o s . s y s t e m , < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > a r g s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c m d < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > e x e c u t a b l e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . j o i n ( a r g s ) < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > , ) , < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > d a e m o n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > T r u e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) . s t a r t ( ) < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > sys . exit ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 0 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c a l l _ r e s t a r t _ c o u n t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > + = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 1 < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - r e s t a r t - p r o c e s s - s e l f - n a m e - o p t i o n a l - s t r - n o n e " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > r e s t a r t _ p r o c e s s ( s e l f , n a m e : O p t i o n a l [ s t r ] = N o n e ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - r e s t a r t - p r o c e s s - s e l f - n a m e - o p t i o n a l - s t r - n o n e " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` r e s t a r t _ p r o c e s s ( s e l f , n a m e : O p t i o n a l [ s t r ] = N o n e ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 停 止 轻 雪 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > n a m e ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / t y p i n g . h t m l # t y p i n g . O p t i o n a l " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > O p t i o n a l < / c o d e > < / a > [ < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / s t d t y p e s . h t m l # s t r " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > s t r < / c o d e > < / a > ] ) : 进 程 名 . D e f a u l t s t o N o n e . < / l i > < / u l > < / b l o c k q u o t e > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 1 5 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > r e s t a r t _ p r o c e s s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , n a m e : O p t i o n a l [ < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s t r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ] < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > N o n e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 停止轻雪 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > name ( [ \ ` Optional \` ](https%3A//docs.python.org/3/library/typing.html#typing.Optional)[[ \` str \` ](https%3A//docs.python.org/3/library/stdtypes.html#str)]): 进程名. Defaults to None.</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > n a m e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > n o t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > N o n e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > chan _active < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ c h a n n e l ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > n a m e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > - a c t i v e & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > chan _active . send ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 1 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > for < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > p r o c e s s _ n a m e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . p r o c e s s _ m a n a g e r . p r o c e s s e s : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > chan _active < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ c h a n n e l ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > p r o c e s s _ n a m e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > - a c t i v e & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > chan _active . send ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > 1 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - i n i t - s e l f - a r g s - k w a r g s " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > i n i t ( s e l f , * a r g s , * * k w a r g s ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - i n i t - s e l f - a r g s - k w a r g s " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` i n i t ( s e l f , * a r g s , * * k w a r g s ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 初 始 化 轻 雪 , 自 动 调 用 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > * a r g s : 参 数 < / l i > < l i > * * k w a r g s : 关 键 字 参 数 < / l i > < / u l > < / b l o c k q u o t e > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 3 0 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > i n i t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > * < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > a r g s , < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > * * < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > k w a r g s ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 初始化轻雪 , 自动调用 < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > * args : 参数 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > * * kwargs : 关键字参数 < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . i n i t _ l o g g e r ( ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - i n i t - l o g g e r - s e l f " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > i n i t _ l o g g e r ( s e l f ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - i n i t - l o g g e r - s e l f " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` i n i t _ l o g g e r ( s e l f ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 初 始 化 日 志 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 3 9 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > i n i t _ l o g g e r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f ) : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 初始化日志 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > init _log ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # E 3 6 2 0 9 ; - - s h i k i - d a r k : # F F A B 7 0 ; " > c o n f i g < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . c o n f i g ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - s t o p - s e l f " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > s t o p ( s e l f ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - s t o p - s e l f " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` s t o p ( s e l f ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 停 止 轻 雪 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 4 5 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > s t o p < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 停止轻雪 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . p r o c e s s _ m a n a g e r . t e r m i n a t e _ a l l ( ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . s t o p _ e v e n t . s e t ( ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - b e f o r e - s t a r t - s e l f - f u n c - l i f e s p a n - f u n c - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ b e f o r e _ s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) - & g t ; L I F E S P A N _ F U N C < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - b e f o r e - s t a r t - s e l f - f u n c - l i f e s p a n - f u n c - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ b e f o r e _ s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) - & g t ; L I F E S P A N _ F U N C \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 启 动 前 的 函 数 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 5 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ b e f o r e _ s t a r t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) - & g t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册启动前的函数 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ b e f o r e _ s t a r t ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - a f t e r - s t a r t - s e l f - f u n c - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ a f t e r _ s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - a f t e r - s t a r t - s e l f - f u n c - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ a f t e r _ s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 启 动 后 的 函 数 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 6 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ a f t e r _ s t a r t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册启动后的函数 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ a f t e r _ s t a r t ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - a f t e r - s h u t d o w n - s e l f - f u n c - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ a f t e r _ s h u t d o w n ( s e l f , f u n c : L I F E S P A N _ F U N C ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - a f t e r - s h u t d o w n - s e l f - f u n c - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ a f t e r _ s h u t d o w n ( s e l f , f u n c : L I F E S P A N _ F U N C ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 停 止 后 的 函 数 : 未 实 现 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 7 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ a f t e r _ s h u t d o w n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册停止后的函数 : 未实现 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ a f t e r _ s h u t d o w n ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - b e f o r e - p r o c e s s - s h u t d o w n - s e l f - f u n c - p r o c e s s - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ b e f o r e _ p r o c e s s _ s h u t d o w n ( s e l f , f u n c : P R O C E S S _ L I F E S P A N _ F U N C ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - b e f o r e - p r o c e s s - s h u t d o w n - s e l f - f u n c - p r o c e s s - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ b e f o r e _ p r o c e s s _ s h u t d o w n ( s e l f , f u n c : P R O C E S S _ L I F E S P A N _ F U N C ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 进 程 停 止 前 的 函 数 , 为 子 进 程 停 止 时 调 用 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - p r o c e s s - l i f e s p a n - f u n c " > < c o d e > P R O C E S S _ L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - p r o c e s s - l i f e s p a n - f u n c " > < c o d e > P R O C E S S _ L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 8 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ b e f o r e _ p r o c e s s _ s h u t d o w n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > P R O C E S S _ L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册进程停止前的函数 , 为子进程停止时调用 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` PROCESS_LIFESPAN_FUNC \` ](./lifespan#var-process-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` PROCESS_LIFESPAN_FUNC \` ](./lifespan#var-process-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ b e f o r e _ p r o c e s s _ s h u t d o w n ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - b e f o r e - p r o c e s s - r e s t a r t - s e l f - f u n c - p r o c e s s - l i f e s p a n - f u n c - p r o c e s s - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ b e f o r e _ p r o c e s s _ r e s t a r t ( s e l f , f u n c : P R O C E S S _ L I F E S P A N _ F U N C ) - & g t ; P R O C E S S _ L I F E S P A N _ F U N C < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - b e f o r e - p r o c e s s - r e s t a r t - s e l f - f u n c - p r o c e s s - l i f e s p a n - f u n c - p r o c e s s - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ b e f o r e _ p r o c e s s _ r e s t a r t ( s e l f , f u n c : P R O C E S S _ L I F E S P A N _ F U N C ) - & g t ; P R O C E S S _ L I F E S P A N _ F U N C \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 进 程 重 启 前 的 函 数 , 为 子 进 程 重 启 时 调 用 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - p r o c e s s - l i f e s p a n - f u n c " > < c o d e > P R O C E S S _ L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - p r o c e s s - l i f e s p a n - f u n c " > < c o d e > P R O C E S S _ L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 1 9 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ b e f o r e _ p r o c e s s _ r e s t a r t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > P R O C E S S _ L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) - & g t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > P R O C E S S _ L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册进程重启前的函数 , 为子进程重启时调用 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` PROCESS_LIFESPAN_FUNC \` ](./lifespan#var-process-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` PROCESS_LIFESPAN_FUNC \` ](./lifespan#var-process-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ b e f o r e _ p r o c e s s _ r e s t a r t ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 4 i d = " f u n c - o n - a f t e r - r e s t a r t - s e l f - f u n c - l i f e s p a n - f u n c " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > o n _ a f t e r _ r e s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - o n - a f t e r - r e s t a r t - s e l f - f u n c - l i f e s p a n - f u n c " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` o n _ a f t e r _ r e s t a r t ( s e l f , f u n c : L I F E S P A N _ F U N C ) \ ` & q u o t ; " > < / a > < / h 4 > < p > < s t r o n g > 说 明 < / s t r o n g > : 注 册 重 启 后 的 函 数 : 未 实 现 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > f u n c ( < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > ) : 生 命 周 期 函 数 < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " . / l i f e s p a n . h t m l # v a r - l i f e s p a n - f u n c " > < c o d e > L I F E S P A N _ F U N C < / c o d e > < / a > : 生 命 周 期 函 数 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 2 0 3 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > o n _ a f t e r _ r e s t a r t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( s e l f , f u n c : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > L I F E S P A N _ F U N C < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 注册重启后的函数 : 未实现 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func ( [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func)): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` LIFESPAN_FUNC \` ](./lifespan#var-lifespan-func): 生命周期函数</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s e l f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > . l i f e s p a n . o n _ a f t e r _ r e s t a r t ( f u n c ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 3 i d = " f u n c - g e t - b o t - l i t e y u k i b o t " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > g e t _ b o t ( ) - & g t ; L i t e y u k i B o t < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - g e t - b o t - l i t e y u k i b o t " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` g e t _ b o t ( ) - & g t ; L i t e y u k i B o t \ ` & q u o t ; " > < / a > < / h 3 > < p > < s t r o n g > 说 明 < / s t r o n g > : 获 取 轻 雪 实 例 < / p > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " # c l a s s - l i t e y u k i b o t " > < c o d e > L i t e y u k i B o t < / c o d e > < / a > : 轻 雪 实 例 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 2 1 7 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > g e t _ b o t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( ) - & g t ; L i t e y u k i B o t : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 获取轻雪实例 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` LiteyukiBot \` ](#class-liteyukibot): 轻雪实例</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > I S _ M A I N _ P R O C E S S < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > _ B O T _ I N S T A N C E < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i s < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > N o n e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > raise < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > R u n t i m e E r r o r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; L i t e y u k i i n s t a n c e n o t i n i t i a l i z e d . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > _ B O T _ I N S T A N C E < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > raise < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > R u n t i m e E r r o r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; C a n & # 3 9 ; t g e t b o t i n s t a n c e i n s u b p r o c e s s . & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 3 i d = " f u n c - g e t - c o n f i g - k e y - s t r - d e f a u l t - a n y - n o n e - a n y " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > g e t _ c o n f i g ( k e y : s t r , d e f a u l t : A n y = N o n e ) - & g t ; A n y < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - g e t - c o n f i g - k e y - s t r - d e f a u l t - a n y - n o n e - a n y " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` g e t _ c o n f i g ( k e y : s t r , d e f a u l t : A n y = N o n e ) - & g t ; A n y \ ` & q u o t ; " > < / a > < / h 3 > < p > < s t r o n g > 说 明 < / s t r o n g > : 获 取 配 置 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > k e y ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / s t d t y p e s . h t m l # s t r " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > s t r < / c o d e > < / a > ) : 配 置 键 < / l i > < l i > d e f a u l t ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / f u n c t i o n s . h t m l # a n y " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > A n y < / c o d e > < / a > , o p t i o n a l ) : 默 认 值 . D e f a u l t s t o N o n e . < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / f u n c t i o n s . h t m l # a n y " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > A n y < / c o d e > < / a > : 配 置 值 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 2 3 2 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > g e t _ c o n f i g < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( k e y : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s t r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > , d e f a u l t : A n y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > N o n e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) - & g t ; A n y : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 获取配置 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > key ( [ \ ` str \` ](https%3A//docs.python.org/3/library/stdtypes.html#str)): 配置键</span></span>
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > default ( [ \ ` Any \` ](https%3A//docs.python.org/3/library/functions.html#any), optional): 默认值. Defaults to None.</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` Any \` ](https%3A//docs.python.org/3/library/functions.html#any): 配置值</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
2024-09-01 13:25:37 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ b o t ( ) . c o n f i g . g e t ( k e y , d e f a u l t ) < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > < h 3 i d = " f u n c - g e t - c o n f i g - w i t h - c o m p a t - k e y - s t r - c o m p a t - k e y s - t u p l e - s t r - d e f a u l t - a n y - n o n e - a n y " t a b i n d e x = " - 1 " > < e m > < s t r o n g > f u n c < / s t r o n g > < / e m > < c o d e > g e t _ c o n f i g _ w i t h _ c o m p a t ( k e y : s t r , c o m p a t _ k e y s : t u p l e [ s t r ] , d e f a u l t : A n y = N o n e ) - & g t ; A n y < / c o d e > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # f u n c - g e t - c o n f i g - w i t h - c o m p a t - k e y - s t r - c o m p a t - k e y s - t u p l e - s t r - d e f a u l t - a n y - n o n e - a n y " a r i a - l a b e l = " P e r m a l i n k t o & q u o t ; * * * f u n c * * * \ ` g e t _ c o n f i g _ w i t h _ c o m p a t ( k e y : s t r , c o m p a t _ k e y s : t u p l e [ s t r ] , d e f a u l t : A n y = N o n e ) - & g t ; A n y \ ` & q u o t ; " > < / a > < / h 3 > < p > < s t r o n g > 说 明 < / s t r o n g > : 获 取 配 置 , 兼 容 旧 版 本 < / p > < p > < s t r o n g > 参 数 < / s t r o n g > : < / p > < b l o c k q u o t e > < u l > < l i > k e y ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / s t d t y p e s . h t m l # s t r " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > s t r < / c o d e > < / a > ) : 配 置 键 < / l i > < l i > c o m p a t _ k e y s ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / s t d t y p e s . h t m l # t u p l e " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > t u p l e < / c o d e > < / a > < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / s t d t y p e s . h t m l # s t r " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > s t r < / c o d e > < / a > ) : 兼 容 键 < / l i > < l i > d e f a u l t ( < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / f u n c t i o n s . h t m l # a n y " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > A n y < / c o d e > < / a > , o p t i o n a l ) : 默 认 值 . D e f a u l t s t o N o n e . < / l i > < / u l > < / b l o c k q u o t e > < p > < s t r o n g > 返 回 < / s t r o n g > : < a h r e f = " h t t p s : / / d o c s . p y t h o n . o r g / 3 / l i b r a r y / f u n c t i o n s . h t m l # a n y " t a r g e t = " _ b l a n k " r e l = " n o r e f e r r e r " > < c o d e > A n y < / c o d e > < / a > : 配 置 值 < / p > < d e t a i l s > < s u m m a r y > < b > 源 代 码 < / b > 或 < a h r e f = " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / t r e e / m a i n / l i t e y u k i / b o t / _ _ i n i t _ _ . p y # L 2 4 4 " t a r g e t = " _ b l a n k " > 在 G i t H u b 上 查 看 < / a > < / s u m m a r y > < d i v c l a s s = " l a n g u a g e - p y t h o n v p - a d a p t i v e - t h e m e " > < b u t t o n t i t l e = " C o p y C o d e " c l a s s = " c o p y " > < / b u t t o n > < s p a n c l a s s = " l a n g " > p y t h o n < / s p a n > < p r e c l a s s = " s h i k i s h i k i - t h e m e s g i t h u b - l i g h t g i t h u b - d a r k v p - c o d e " t a b i n d e x = " 0 " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > d e f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 6 F 4 2 C 1 ; - - s h i k i - d a r k : # B 3 9 2 F 0 ; " > g e t _ c o n f i g _ w i t h _ c o m p a t < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ( k e y : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s t r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > , c o m p a t _ k e y s : t u p l e [ < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > s t r < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ] , d e f a u l t : A n y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > = < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > N o n e < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) - & g t ; A n y : < / s p a n > < / s p a n >
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 获取配置 , 兼容旧版本 < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > key ( [ \ ` str \` ](https%3A//docs.python.org/3/library/stdtypes.html#str)): 配置键</span></span>
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > compat _keys ( [ \ ` tuple \` ](https%3A//docs.python.org/3/library/stdtypes.html#tuple)[ \` str \` ](https%3A//docs.python.org/3/library/stdtypes.html#str)): 兼容键</span></span>
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > default ( [ \ ` Any \` ](https%3A//docs.python.org/3/library/functions.html#any), optional): 默认值. Defaults to None.</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns : < / s p a n > < / s p a n >
2024-08-31 19:52:23 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > [ \ ` Any \` ](https%3A//docs.python.org/3/library/functions.html#any): 配置值</span></span>
2024-08-31 19:08:18 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > & quot ; & quot ; & quot ; < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > k e y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ b o t ( ) . c o n f i g : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ b o t ( ) . c o n f i g [ k e y ] < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > for < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c o m p a t _ k e y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c o m p a t _ k e y s : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c o m p a t _ k e y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > i n < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ b o t ( ) . c o n f i g : < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > logger . warning ( < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & # 3 9 ; C o n f i g k e y & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c o m p a t _ k e y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; w i l l b e d e p r e c a t e d , u s e & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > { < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > k e y < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 0 5 C C 5 ; - - s h i k i - d a r k : # 7 9 B 8 F F ; " > } < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; i n s t e a d . & # 3 9 ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > ) < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > g e t _ b o t ( ) . c o n f i g [ c o m p a t _ k e y ] < / s p a n > < / s p a n >
2024-09-01 00:03:58 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > d e f a u l t < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / d e t a i l s > ` , 8 6 ) , e = [ l ] ; f u n c t i o n p ( h , k , r , o , d , g ) { r e t u r n a ( ) , i ( " d i v " , n u l l , e ) } c o n s t c = s ( t , [ [ " r e n d e r " , p ] ] ) ; e x p o r t { y a s _ _ p a g e D a t a , c a s d e f a u l t } ;