Converting to “discord.member” failed for parameter “member”

async def test(ctx,user : discord.member):
    if user==None:"test.jpg")
    data = BytesIO(await
    await ctx.send(file=discord.file('test1.jpg'))

its not working and i am getting following errors

if i type !test it would show me this error discord.ext.commands.errors.MissingRequiredArgument: user is a required argument that is missing.

but if use !test @mention.some.username it will show me this error Converting to “discord.member” failed for parameter “user”.


There are two mistakes that you are doing here.

  • discord.member is a module, You are meant to use discord.Member class for annotation of user.
  • You are doing:
    if user == None:
      user =
    but you haven’t set a default value to user so it is a required argument.

The correct way is:

async def test(ctx, user: discord.Member = None):
  if user is None:
    user =

  # rest of code here

We just declared a default value to the user as None and properly annotate user as discord.Member