Harden JSON event parsing and broadcast message formatting
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
+1
-2
@@ -84,7 +84,7 @@ class EventParser:
|
||||
except json.JSONDecodeError as e:
|
||||
logger.debug(f'JSON decode error: {e}')
|
||||
return None
|
||||
except (KeyError, TypeError) as e:
|
||||
except (KeyError, TypeError, ValueError) as e:
|
||||
logger.debug(f'Error parsing event: {e}')
|
||||
return None
|
||||
|
||||
@@ -212,7 +212,6 @@ class EventParser:
|
||||
else:
|
||||
weapon_name = WEAPON_NAMES.get(weapon, weapon)
|
||||
return f"{score_prefix}{killer_prefix}^8{killer_name}^0 ^7committed suicide with the ^7{weapon_name}{warmup}\n"
|
||||
return None
|
||||
|
||||
# Regular kill: +1 for killer
|
||||
if not data.get('WARMUP', False):
|
||||
|
||||
Reference in New Issue
Block a user