From cf912a4a72b4095965049146be4c6d18002c9b31 Mon Sep 17 00:00:00 2001 From: blank X Date: Wed, 21 Oct 2020 21:28:13 +0700 Subject: [PATCH] Add support for DEAI banstack trigger --- sukuinote/plugins/einfo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sukuinote/plugins/einfo.py b/sukuinote/plugins/einfo.py index dfa478f..45d3fc9 100644 --- a/sukuinote/plugins/einfo.py +++ b/sukuinote/plugins/einfo.py @@ -136,8 +136,12 @@ async def get_deai(client, entity): text += f'--- {i}\n' text += f'- Risk Factor: {match.group(2).capitalize()}\n' text += f'- Module: {DEAI_MODULE_CODES.get(match.group(3), match.group(3))}' - if (match.group(4) or '').strip(): - text += f'\n- Comment: {html.escape(match.group(4).strip())}' + comment = (match.group(4) or '').strip() + if comment: + text += f'\n- Comment: {html.escape(comment)}' + match = re.match(r'^banstack trigger:0x(\d{2})$', comment) + if match: + text += f'\n- Banstack Trigger Code: {DEAI_BAN_CODES.get(match.group(1), "0x" + match.group(1))}' return text return '- 404: Not Found'