mirror of
				https://gitlab.com/ddorn/tfjm-discord-bot.git
				synced 2025-10-31 01:39:52 +01:00 
			
		
		
		
	:fix: show order of tirage
This commit is contained in:
		| @@ -4,6 +4,7 @@ import os | |||||||
| import sys | import sys | ||||||
| import traceback | import traceback | ||||||
| from collections import defaultdict | from collections import defaultdict | ||||||
|  | from operator import attrgetter | ||||||
| from time import sleep | from time import sleep | ||||||
| from typing import List, Dict | from typing import List, Dict | ||||||
|  |  | ||||||
| @@ -130,6 +131,15 @@ class OrderPhase(Phase): | |||||||
|         orders = [team.tirage_order for team in self.teams] |         orders = [team.tirage_order for team in self.teams] | ||||||
|         if len(set(orders)) == len(orders): |         if len(set(orders)) == len(orders): | ||||||
|             # All dice are different: good |             # All dice are different: good | ||||||
|  |             # We sort the teams so all tirages are in this order | ||||||
|  |             self.tirage.teams = sorted(self.teams, key=attrgetter("tirage_order")) | ||||||
|  |             await ctx.send( | ||||||
|  |                 "L'ordre des tirages pour ce tour est donc :\n" | ||||||
|  |                 " - " | ||||||
|  |                 + "\n - ".join( | ||||||
|  |                     f"{team.role.mention} ({team.tirage_order})" for team in self.teams | ||||||
|  |                 ) | ||||||
|  |             ) | ||||||
|             return self.NEXT |             return self.NEXT | ||||||
|         else: |         else: | ||||||
|             # Find dice that are the same |             # Find dice that are the same | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user