Skip to content
← Back to Community
Delete all discord messages
Profile icon
JoeIsHere

So i wan't to do a simple command %DeleteAll to delete all messages in the text channel.
DELETUSUS

Voters
Profile icon
ANGELICAGRACEGR
Profile icon
KelvinCousins
Profile icon
JoeIsHere
Comments
hotnewtop
Profile icon
Coder100

what language?

Profile icon
JoeIsHere

@Coder100 Im using python

Profile icon
Coder100
Profile icon
Coder100
Profile icon
SixBeeps

Something like this should work:

deleted = await channel.purge(check=true) await channel.send('Deleted {} message(s)'.format(len(deleted)))

EDIT: Doing some research, it may not be possible to delete all messages at once, due to that being heavy on Discord's end. If you really want to delete every single message, you could just delete the channel entirely and create a new one.