Reputation: 62
I am trying to add a role to a person, which I have done, but also want to delete the message right after. Any I ideas on how to delete the message?
@client.command(pass_context=True)
async def addrole(ctx, *, role):
user = ctx.message.author
try:
await user.add_roles(discord.utils.get(user.guild.roles, name=role))
except Exception as e:
await ctx.send('Only the team you are on please! Error: ' + str(e))
Upvotes: 1
Views: 78
Reputation: 1829
The message you get from context can just be called:
await ctx.message.delete()
Upvotes: 1