Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

discord.ext.commands.errors.MissingRequiredArgument: user is a required argument that is missing

I’ve only seen no solutions for this, but im trying to check if the role of the user that sent the message is a DJ, if so then skip = True however i keep getting this error message

    async def skip(self, ctx, user: discord.Member):
        role = discord.utils.find(lambda r: r.name == 'DJ', ctx.message.guild.roles)

        if role in user.roles:
            skip = True

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

If you want to access the user that invoked the command use ctx.author:

    async def skip(self, ctx):
        role = discord.utils.find(lambda r: r.name == 'DJ', ctx.message.guild.roles)

        if role in ctx.author.roles:
            skip = True
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading