🐛 fix tirages for finale

This commit is contained in:
ddorn 2020-05-20 12:54:46 +02:00
parent 161478caf8
commit fd000958a7
3 changed files with 25 additions and 22 deletions

View File

@ -13,6 +13,7 @@ import discord
import yaml
from src.constants import *
from src.utils import pprint_send
def skip_if(check, default=None):
@ -280,7 +281,8 @@ class BaseTirage(yaml.YAMLObject):
i += 1
# The conflicts
order = doubles + order
self.poules[poule] = order
self.poules[poule] = [t.name for t in order]
await self.annonce_poule(poule)

View File

@ -288,7 +288,7 @@ class DevCog(Cog, name="Dev tools"):
pprint(resp, out)
embed = discord.Embed(title="Result", color=discord.Colour.green())
embed.add_field(name="Query", value=f"```py\n{full_query}```", inline=False)
embed.add_field(name="Query", value=f"```py\n{query}```", inline=False)
value = self.to_field_value(out)
if resp is not None and value:

View File

@ -279,8 +279,8 @@ class DiscordTirage(BaseTirage):
if len(teams) == 3:
table = """```
Phase 1 Phase 2 Phase 3
Pb {0.pb} Pb {1.pb} Pb {2.pb}
T F Phase 1 Phase 2 Phase 3
J M Pb {0.pb} Pb {1.pb} Pb {2.pb}
{0.name} Def Rap Opp
@ -292,7 +292,7 @@ class DiscordTirage(BaseTirage):
table = """```
+-----+---------+---------+---------+---------+
| | Phase 1 | Phase 2 | Phase 3 | Phase 4 |
| | Pb {0.pb} | Pb {1.pb} | Pb {2.pb} | Pb {3.pb} |
| | Pb {0.pb} | Pb {1.pb} | Pb {2.pb} | Pb {3.pb} |
+-----+---------+---------+---------+---------+
| {0.name} | Déf | | Rap | Opp |
+-----+---------+---------+---------+---------+
@ -304,22 +304,22 @@ class DiscordTirage(BaseTirage):
+-----+---------+---------+---------+---------+```"""
elif len(teams) == 5:
table = """```
Phase 1 Phase 2 Phase 3
Salle 1 Salle 2 Salle 1 Salle 2 Salle 1
Pb {0.pb} Pb {1.pb} Pb {2.pb} Pb {3.pb} Pb {4.pb}
{0.name} Def Opp Rap
{1.name} Def Rap Opp
{2.name} Opp Def Rap
{3.name} Rap Opp Def
{4.name} Rap Opp Def
```"""
Phase 1 Phase 2 Phase 3
Salle 1 Salle 2 Salle 1 Salle 2 Salle 1
Pb. {0.pb} Pb. {1.pb} Pb. {2.pb} Pb. {3.pb} Pb. {4.pb}
{0.name} Def Opp Rap
{1.name} Def Rap Opp
{2.name} Opp Def Rap
{3.name} Rap Opp Def
{4.name} Rap Opp Def
```"""
else:
table = "WTF il n'y a pas 3,4 ou 5 equipes ici."
@ -536,7 +536,8 @@ class TirageCog(Cog, name="Tirages"):
await ctx.send(f"Le problème tiré est... **{problem}**")
@commands.command(
name="oui", aliases=["accept", "yes", "o", "oh-yeaaah", "accepte", "ouiiiiiii"],
name="oui",
aliases=["accept", "yes", "o", "oh-yeaaah", "accepte", "ouiiiiiii", "owi"],
)
async def accept_cmd(self, ctx):
"""