C:/Program Files/Git/bk_week_approve command

This commit is contained in:
2025-02-12 13:48:23 +01:00
parent 99215d17e2
commit 67052b1511
9 changed files with 70 additions and 39 deletions
+3 -1
View File
@@ -36,6 +36,7 @@ async def parse_json(response: str, bot: botPy.Bot):
json_response = json.loads(json_str)
result = await json_to_func(json_response, bot)
await ws_global.ping()
print(result)
await send_message(f"json:{json.dumps(result)}")
except json.JSONDecodeError as e:
if bot.args["dev"]: py_print(f"failed to parse json: {json_str}\n reason: {e}")
@@ -60,7 +61,8 @@ async def json_to_func(v: dict, bot: botPy.Bot) -> dict:
match v["value"]:
case "update_data_file": result = {"type": "result", "value": data.write_data(bot)}
case "add_post_url": result = {"type": "result", "value": await posts.add_post_url(bot, *v["args"])}
case "add_post_url": result = {"type": "result", "value": posts.add_post_url(bot, *v["args"])}
case "set_approve_post": result = {"type": "result", "value": data.set_approve_post(bot, *v["args"])}
case _: value_supported = False
if bot.args["dev"] and not value_supported: