WebAug 14, 2024 · @commands.Cog.listener () async def on_message_delete (self, … WebJun 14, 2024 · You can use await ctx.channel.purge () to delete all messages in an instant. This is an example: import discord from discord.ext import commands client = commands.Bot (command_prefix = ".") @client.command () async def clear (ctx): await ctx.channel.purge () Share Improve this answer Follow answered Jul 1, 2024 at 21:59 …
Python discord.py delete a chat with with a certain id/message
WebApr 10, 2024 · import discord from discord.ext import commands mybot = commands.Bot (command_prefix='$', help_command=None) # help_command to disable the default one created by this library. @mybot.event async def on_ready (): # To confirm that BOT is online. print ('I am not online. dr drew white iowa
python - Deleting User Messages in Discord.py - Stack Overflow
WebAug 17, 2024 · for reaction in message.reactions: for user in await reaction.users ().flatten (): if user != client.user: #check if the user is the bot, might be slightly different for you await reaction.remove (user) Share Improve this answer Follow answered Aug 17, 2024 at 9:28 LoahL 2,314 1 9 24 WebThat is the command to delete messages Share Improve this answer Follow answered Sep 15, 2024 at 19:44 user12867493 This is for the newer discord.py-rewrite branch. The code in the question above is from the older async branch (note send_message over send, etc.) – Patrick Haugh Sep 15, 2024 at 19:45 Add a comment Your Answer Post Your Answer WebFeb 18, 2024 · 1 Use a converter to get the discord.Message instance of the message: @client.command () async def react (ctx, message: discord.Message): ... Then use Message.add_reaction to add a reaction to it, which I'm sure you can figure out by yourself. dr dreyer emory spine center