Closed calebcmn closed 7 years ago
await self.bot.delete_message(channel)
http://discordpy.readthedocs.io/en/latest/api.html#discord.Client.delete_message
The code that you sent does not correlate at all with the traceback that you included.
@TheTrain2000 sorry about that, slight typo. I edited the message.
@slice I meant to have that included, I just copied too little of my code.
slice is pointing out the fact that you should read the documentation for delete_message
, rather than saying that you didn't include it in your code snippet. On the last line of your code you have await self.bot.delete_message(channel)
, when you should in fact be doing await self.bot.delete_message(ctx.message)
because according to the docs, delete_message()
takes a Message
object.
@TheTrain2000 sorry, I'm quite new to python, and I did indeed head over to read the docs before reporting the issue here but I couldn't understand it.
I am making a discord bot in python. Today, I was coding a 'say' command, where the goal is:
User: [p]say Hello!
Bot: Hello!
User's message deleted
The code I have so far is this:
When I attempt to run the command, the bot returns the message but does not delete the user's message. The output in the console is this:
I would really like some help fixing this, and if you need any more info just let me know!