diff --git a/app/task.py b/app/task.py index 0e3d8a5..1fbba31 100644 --- a/app/task.py +++ b/app/task.py @@ -289,6 +289,14 @@ def process_new_robot(app_id, app_secret, action_data): robot_uuid = "" catagory_table_record = {"UUID": robot_uuid, "名称": name, "分类": "官方指令"} + client = ( + lark.Client.builder() + .app_id(app_id) + .app_secret(app_secret) + .log_level(lark.LogLevel.DEBUG) + .build() + ) + if category == "optRTwYcra": robot_uuid = new_blank_robot(name, user_id) catagory_table_record["分类"] = "官方应用" @@ -311,11 +319,4 @@ def process_new_robot(app_id, app_secret, action_data): table_id = "tbl2GcBvkvMtOBnl" bitable_token = os.environ["OFFICE_XBOT_BITABLE_TOKEN"] - client = ( - lark.Client.builder() - .app_id(app_id) - .app_secret(app_secret) - .log_level(lark.LogLevel.DEBUG) - .build() - ) add_record(client, bitable_token, table_id, catagory_table_record)