Skip to content

Commit

Permalink
优化selfid获取流程
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Oct 31, 2023
1 parent 6999e47 commit 28c1845
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions OlivOS/dodoLinkSDK.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,17 @@ def get_Event_from_SDK(target_event):
if plugin_event_bot_hash not in sdkSubSelfInfo:
api_msg_obj = API.getMe(tmp_bot_info)
try:
api_msg_obj.do_api('POST')
api_res_json = json.loads(api_msg_obj.res)
if api_res_json['status'] == 0:
sdkSubSelfInfo[plugin_event_bot_hash] = str(api_res_json['data'].get('dodoSourceId', None))
if target_event.platform['model'] == 'v1':
if target_event.platform['model'] == 'v1':
api_msg_obj.host = sdkAPIHost['v1']
api_msg_obj.do_api('POST')
api_res_json = json.loads(api_msg_obj.res)
if api_res_json['status'] == 0:
sdkSubSelfInfo[plugin_event_bot_hash] = str(api_res_json['data'].get('dodoId', None))
else:
api_msg_obj.do_api('POST')
api_res_json = json.loads(api_msg_obj.res)
if api_res_json['status'] == 0:
sdkSubSelfInfo[plugin_event_bot_hash] = str(api_res_json['data'].get('dodoSourceId', None))
except:
pass
try:
Expand Down

0 comments on commit 28c1845

Please sign in to comment.