diff --git a/app.py b/app.py index 8974f32..bcd0bd4 100644 --- a/app.py +++ b/app.py @@ -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