-1
Hello, I was making a message with the discord.Embed
, only that I want that in case the user does not send the message correctly, the bot send a message Embed
error.
I tried this way only that the following mistake: discord.ext.commands.errors.MissingRequiredArgument: user is a required argument that is missing.
@client.command()
async def remcargo (ctx, role: d.Role, user: d.Member):
embed = d.Embed(
title='Sucesso',
description=f"Removido com sucesso {role.mention} from {user.mention}.",
colour=d.Colour.green()
)
fembed = d.Embed(
title='Erro',
description=f"Não foi possível realizar o comando, Verifique se digitou corretamente",
colour=d.Colour.red()
)
try:
if ctx.author.guild_permissions.administrator:
await user.remove_roles(role)
await ctx.send(embed=embed)
except:
await ctx.send(embed=fembed)
Okay, I put this command, only now it’s giving another problem: Unresolved Reset "Nothing"
– Sandro Paculski
I was wrong instead of
Nothing
isNone
. I edited my answer– Natan Fernandes
Ok! now it worked! Thank you very much
– Sandro Paculski
I suggest searching for optional parameters in functions
– Natan Fernandes