fix: 修复 TUN-36 重复提醒的问题
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ching 2024-03-24 12:37:24 +08:00
parent 8afd4b4132
commit 3a2c0a510b

17
app.py
View File

@ -60,14 +60,15 @@ def linear_issue():
notify_type = apprise.NotifyType.SUCCESS
apobj.notify(body=body, title=title, notify_type=notify_type)
elif data['action'] == 'create':
title = data['data']['identifier'] + ' - ' + data['data']['title']
body = f"创建 issue。\n#Status\n{data['data']['state']['name']}"
notify_type = apprise.NotifyType.INFO
for label in data['data']['labels']:
if label['name'] == 'Bug':
notify_type = apprise.NotifyType.FAILURE
break
apobj.notify(body=body, title=title, notify_type=notify_type)
if not data['data'].get('botActor', {}).get('subType') == 'discord':
title = data['data']['identifier'] + ' - ' + data['data']['title']
body = f"创建 issue。\n#Status\n{data['data']['state']['name']}"
notify_type = apprise.NotifyType.INFO
for label in data['data']['labels']:
if label['name'] == 'Bug':
notify_type = apprise.NotifyType.FAILURE
break
apobj.notify(body=body, title=title, notify_type=notify_type)
return jsonify({'message': 'Ok'}), 200