From ae5757aceb4a69ae0fd6060cd013bd32cfd05606 Mon Sep 17 00:00:00 2001 From: ddorn Date: Mon, 27 Apr 2020 15:07:21 +0200 Subject: [PATCH] :sprkles: team creation command --- src/cogs/teams.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cogs/teams.py b/src/cogs/teams.py index d681998..598d56c 100644 --- a/src/cogs/teams.py +++ b/src/cogs/teams.py @@ -57,8 +57,22 @@ class TeamsCog(Cog, name="Teams"): ) else: # Team creation ! + guild: discord.Guild = ctx.guild + team_role = await guild.create_role( + name=trigram, + color=discord.Colour.from_rgb(255, 255, 255), + reason="Creation of a new team", + ) + tournoi = get(guild.roles, name=team.tournoi) - await ctx.send(f"Creation de l'équipe {trigram} avec {team_secret} !") + await ctx.author.add_roles( + team_role, captain_role, tournoi, reason="Creation of team " + trigram + ) + + await ctx.send( + f"L'équipe {team_role.mention} a été créée et son capitaine " + f"est {ctx.author.mention}" + ) def setup(bot: Bot):