File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
nonebot_plugin_l4d2_server Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 2828from nonebot .plugin import on_command
2929from nonebot_plugin_alconna import UniMessage
3030
31- from nonebot_plugin_l4d2_server .l4_ban .utils import refresh_server_command_rule
32-
3331from .config import config , config_manager
3432from .l4_ban import l4_request
33+ from .l4_ban .utils import refresh_server_command_rule
3534from .l4_help import get_l4d2_core_help
3635from .l4_local import * # noqa: F403
3736from .l4_request import (
Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ def reload_ip():
108108 COMMAND .clear ()
109109 for item in server_all_path .iterdir ():
110110 if item .is_file () and item .name .endswith ("json" ):
111- json_data = json .loads (item .read_text (encoding = "utf-8" ))
111+ try :
112+ json_data = json .loads (item .read_text (encoding = "utf-8" ))
113+ except json .JSONDecodeError :
114+ continue
112115 group_server = cast (Dict [str , List [NserverOut ]], json_data )
113116
114117 for group , group_ip in group_server .items ():
You can’t perform that action at this time.
0 commit comments