File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/nonebot_plugin_alconna Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ALCONNA_AUTO_SEND_OUTPUT=true
55ALCONNA_USE_COMMAND_START = true
66ALCONNA_GLOBAL_COMPLETION = '
77{
8- "tab": "true "
8+ "tab": "True "
99}
1010'
1111NBP_ALC_PAGE_SIZE = 6
Original file line number Diff line number Diff line change 2626_modules = set ()
2727
2828
29+ def _get_driver ():
30+ try :
31+ return get_driver ()
32+ except ValueError as e :
33+ raise RuntimeError (* e .args ) from e
34+
35+
2936def check_self_send (bot : Bot , event : Event ) -> bool :
3037 try :
3138 user_id = event .get_user_id ()
@@ -87,7 +94,7 @@ def __init__(
8794 self .comp_config = comp_config
8895 self .use_origin = use_origin or False
8996 try :
90- global_config = get_driver ().config
97+ global_config = _get_driver ().config
9198 config = get_plugin_config (Config )
9299 if config .alconna_global_completion is not None and self .comp_config == {}:
93100 self .comp_config = config .alconna_global_completion
@@ -123,8 +130,10 @@ def __init__(
123130 with command_manager .update (command ):
124131 command .meta .context_style = config .alconna_context_style
125132 self .use_origin = config .alconna_use_origin if use_origin is None else use_origin
126- except ValueError :
133+ except RuntimeError :
127134 self .auto_send = True if auto_send_output is None else auto_send_output
135+ self .response_self = False if response_self is None else response_self
136+ self .use_origin = False if use_origin is None else use_origin
128137
129138 def _update (cmd_id : int ):
130139 try :
You can’t perform that action at this time.
0 commit comments