1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Sort people in the mmevent start message

This commit is contained in:
Steffo 2020-04-27 00:28:12 +02:00
parent 887411df6d
commit e6e6809419

View file

@ -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