💩 improved bad code

This commit is contained in:
ddorn 2020-05-23 22:45:09 +02:00
parent e0c288289d
commit 0f541291f2
1 changed files with 5 additions and 6 deletions

View File

@ -114,13 +114,12 @@ class TeamsCog(Cog, name="Teams"):
touriste_role = get(guild.roles, name=Role.TOURIST) touriste_role = get(guild.roles, name=Role.TOURIST)
if tournoi == "Finale": if tournoi == "Finale":
# we don't give the "Finaliste" role to the tourists, it would give them rights. # we don't give the "Finaliste" role to the tourists, it would give them rights.1
# to simplify branching we assign twice "Touriste" roles = (touriste_role,)
touriste_role = touriste_role else:
roles = touriste_role, tournoi_role
await ctx.author.add_roles( await ctx.author.add_roles(*roles, reason="Demande via le bot.")
touriste_role, tournoi_role, reason="Demande via le bot."
)
return f"{ctx.author.mention} à été ajouté comme spectateur pour {tournoi}." return f"{ctx.author.mention} à été ajouté comme spectateur pour {tournoi}."