Quantcast
Viewing all articles
Browse latest Browse all 14069

How to make a bot delete a message sent from itself

I have a Discord bot and I want it to delete a "Loading..." message. However it just deletes the user message for the command

@client.command()async def run(ctx):    await ctx.send("Loading...")    await ctx.message.delete()    await ctx.send("Loading Complete!")

This raises insufficient permissions as it is trying to delete the user message instead of the message it just sent.

What am I doing wrong here?


Viewing all articles
Browse latest Browse all 14069

Trending Articles