So, for example, I have this code(in a cog):
@commands.command()
async def send_message(self, ctx, user : discord.Member = None,*, text = None)
if user and text:
await ctx.send(user.mention + text)
elif not user and text:
await ctx.send(text)
this code is supposed to send the message and mention a user if one is mentioned, but if there is no member object in the first argument of the message, it just shows an error and doesn't set text to all the other words in the message. Is there a way for the user argument to be completely ignored if the correct object type is not there?