DeathLink: add support for the cause field

This commit is contained in:
Fabian Dill
2021-11-06 11:19:49 +01:00
parent 30755b2067
commit 720ef936da
2 changed files with 5 additions and 1 deletions

View File

@@ -263,6 +263,11 @@ class CommonContext():
def on_deathlink(self, data: dict):
"""Gets dispatched when a new DeathLink is triggered by another linked player."""
self.last_death_link = max(data["time"], self.last_death_link)
text = data.get("cause", "")
if text:
logger.info(f"DeathLink: {text}")
else:
logger.info(f"DeathLink: Received from {data['source']}")
async def send_death(self):
self.last_death_link = time.time()