mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-29 21:57:14 +00:00
fix: Windows上无法读取和应用命令权限配置的问题
This commit is contained in:
@@ -315,8 +315,12 @@ def register_all():
|
|||||||
|
|
||||||
def apply_privileges():
|
def apply_privileges():
|
||||||
"""读取cmdpriv.json并应用指令权限"""
|
"""读取cmdpriv.json并应用指令权限"""
|
||||||
with open('cmdpriv.json', 'r') as f:
|
# 读取内容
|
||||||
data = json.load(f)
|
json_str = ""
|
||||||
|
with open('cmdpriv.json', 'r', encoding="utf-8") as f:
|
||||||
|
json_str = f.read()
|
||||||
|
|
||||||
|
data = json.loads(json_str)
|
||||||
for path, priv in data.items():
|
for path, priv in data.items():
|
||||||
if path == 'comment':
|
if path == 'comment':
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user