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