commands.Greedy in dpy does not raise error

28 views Asked by At

I have a kick command with commands.Greedy and I have proper error handler too but it never raise errors it even executes command when none of the argument provided

I want it to raise missing argument or invalid member provided errors

This is my code

 @commands.command(name='kick', help=".kick <user(s)> reason=None")

 @commands.is_owner()

 @commands.bot_has_guild_permissions(kick_members=True)

    async def _kick(self, ctx, members:commands.Greedy[discord.Member], *, reason=None):

        if len(members) > 10:

            return await ctx.send(embed=discord.Embed(color=discord.colour.red(), description=f"{warn} | This command cannot accept more than 10 members."))
0

There are 0 answers