From e6e680941960495b0b68dfb4999b2cec261b4fa8 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 27 Apr 2020 00:28:12 +0200 Subject: [PATCH] Sort people in the mmevent start message --- royalpack/commands/matchmaking.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/royalpack/commands/matchmaking.py b/royalpack/commands/matchmaking.py index 8ad3dfd9..ddfc6de4 100644 --- a/royalpack/commands/matchmaking.py +++ b/royalpack/commands/matchmaking.py @@ -150,10 +150,9 @@ class MatchmakingCommand(Command): return callback - @staticmethod - def _gen_event_start_message(mmevent: MMEvent): + def _gen_event_start_message(self, mmevent: MMEvent): text = f"🚩 L'evento [b]{mmevent.title}[/b] è iniziato!\n\n" - for response in mmevent.responses: + for response in sorted(mmevent.responses, key=lambda r: -self._mmchoice_values[r.choice]): response: MMResponse text += f"{response.choice.value} {response.user}\n" return text