Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to make a bot delete a message sent from itself

$
0
0

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 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>