@@ -180,7 +180,7 @@ def set_enabled(self, command: Alconna | str, enabled: bool):
180180 command = self .get_command (command )
181181 if enabled and command ._hash in self .__abandons :
182182 self .__abandons .remove (command ._hash )
183- if not enabled and command not in self .__abandons :
183+ if not enabled and command . _hash not in self .__abandons :
184184 self .__abandons .append (command ._hash )
185185
186186 def add_shortcut (self , target : Alconna , key : str | TPattern , source : ShortcutArgs ):
@@ -285,14 +285,14 @@ def delete_shortcut(self, target: Alconna, key: str | TPattern | None = None):
285285 for prefix in args .prefixes :
286286 _shortcut [1 ].pop (f"{ re .escape (prefix )} { args .origin_key } " )
287287 _shortcut [1 ].pop (args .origin_key , None )
288- return i18n .require ("shortcut" , " delete_success" ).format (shortcut = f"[*]{ args .origin_key } " , target = target .path )
288+ return i18n .require ("shortcut. delete_success" ).format (shortcut = f"[*]{ args .origin_key } " , target = target .path )
289289 for key , args in _shortcut [1 ].items ():
290290 if re .fullmatch (key , _key , args .flags ):
291291 args = _shortcut [1 ][key ]
292292 break
293293 else :
294294 raise ValueError (
295- i18n .require ("manager" , " shortcut_parse_error" ).format (target = f"{ namespace } .{ name } " , query = _key )
295+ i18n .require ("manager. shortcut_parse_error" ).format (target = f"{ namespace } .{ name } " , query = _key )
296296 )
297297 for prefix in args .prefixes :
298298 _shortcut [1 ].pop (f"{ re .escape (prefix )} { args .origin_key } " )
@@ -301,10 +301,10 @@ def delete_shortcut(self, target: Alconna, key: str | TPattern | None = None):
301301 if short .origin_key == args .origin_key :
302302 _shortcut [0 ].pop (key )
303303 break
304- return i18n .require ("shortcut" , " delete_success" ).format (shortcut = f"[*]{ args .origin_key } " , target = target .path )
304+ return i18n .require ("shortcut. delete_success" ).format (shortcut = f"[*]{ args .origin_key } " , target = target .path )
305305 else :
306306 self ._shortcuts .pop (f"{ namespace } .{ name } " )
307- return i18n .require ("shortcut" , " delete_success" ).format (shortcut = "[all]" , target = target .path )
307+ return i18n .require ("shortcut. delete_success" ).format (shortcut = "[all]" , target = target .path )
308308
309309 def get_command (self , command : str ) -> Alconna :
310310 """获取命令"""
0 commit comments