diff --git a/src/cogs/dev.py b/src/cogs/dev.py index 7d714ae..19710c3 100644 --- a/src/cogs/dev.py +++ b/src/cogs/dev.py @@ -72,6 +72,7 @@ class DevCog(Cog, name="Dev tools"): await ctx.send(f":tada: L'extension **{name}** a bien été rechargée.") @command(name="setup-roles") + @has_role(Role.DEV) async def setup_roles(self, ctx): """ (dev) Temporary command to setup the server. diff --git a/src/cogs/teams.py b/src/cogs/teams.py index ce9f605..e950f67 100644 --- a/src/cogs/teams.py +++ b/src/cogs/teams.py @@ -159,12 +159,12 @@ class TeamsCog(Cog, name="Teams"): reason=f"{ctx.author.name} l'a ajouté à son équipe", ) await ctx.send( - f"{member.mention} à été ajouté dans l'équipe {the_team[1].mention}" + f"{member.mention} a été ajouté dans l'équipe {the_team[1].mention}" ) - @team.command(name="channel", ignore_extra=False) + @team.command(name="channel") @commands.has_role(Role.CAPTAIN) - async def team_channel(self, ctx, channel_name): + async def team_channel(self, ctx, *channel_name): """ (cap) Crée une channel privée pour l'équipe @@ -175,6 +175,15 @@ class TeamsCog(Cog, name="Teams"): `!team channel un-nom-sympa` """ + if not channel_name: + await ctx.send( + "Tu dois mettre un nom d'équipe, par exemple " + "`!team channel un-super-nom`" + ) + return + + channel_name = " ".join(channel_name) + guild: discord.Guild = ctx.guild team_role = self.teams_for(ctx.author)[0][1] team_channel_category = get(guild.categories, name=TEAMS_CHANNEL_CATEGORY) diff --git a/src/cogs/tirages.py b/src/cogs/tirages.py index 3ce577a..e71d02c 100644 --- a/src/cogs/tirages.py +++ b/src/cogs/tirages.py @@ -653,13 +653,13 @@ class TirageCog(Cog, name="Tirages"): # ---------- Commandes du groupe draw ----------- # - @group( - name="draw", aliases=["d", "tirage"], - ) + @group(name="draw", aliases=["d", "tirage"], invoke_without_command=True) async def draw_group(self, ctx: Context) -> None: """Groupe de commandes pour les tirages. Détails: `!help draw`""" - print("WTFF") + help = self.bot.get_command("help") + await help.callback(ctx, "draw") + await ctx.send("wtf man") @draw_group.command( name="start", usage="équipe1 équipe2 équipe3 (équipe4)", diff --git a/src/tfjm_discord_bot.py b/src/tfjm_discord_bot.py index 680eb9b..1ac2e36 100644 --- a/src/tfjm_discord_bot.py +++ b/src/tfjm_discord_bot.py @@ -69,6 +69,8 @@ async def on_command_error(ctx: Context, error, *args, **kwargs): # 'Command "NAME" is not found' name = str(error).partition('"')[2].rpartition('"')[0] msg = f"La commande {name} n'éxiste pas. Pour un liste des commandes, envoie `!help`." + elif isinstance(error, commands.MissingRole): + msg = f"Il te faut le role de {error.missing_role} pour utiliser cette commande" else: msg = repr(error)