This was tested only on Debian 9. You need python3 and curl in your path.
Process is relativly straightforward. Change the user, chan, and limit in the script bellow.
Open discord in Firefox, open network tools, refresh page and find following request
Right click on it and copy as curl, paste into
get_msg
without first part slightly changed that is alredy there.
Now delete one of your messages and do same for delete request in return os.system...
Run the script and wait.
import os, json
user = '<your username>' #just username, without #tag
chan = <number after /@me/>
limit = 50 # how many messages to fetch
def get_msg_id(chan):
get_msg = '''curl -s 'https://discordapp.com/api/v6/channels/{0}/messages?limit={1}' -H ... -H 'TE: Trailers' '''.format(chan, limit)
output = os.popen(get_msg).read()
j = json.loads(output)
for i in range(0,limit):
print(j[i]['id'], " | ", j[i]['author']['username'])
if j[i]['author']['username'] == user:
return j[i]['id']
else:
continue
def del_msg(msg_id):
print("Got id:", msg_id)
curl = '''curl 'https://discord.com/api/v6/channels/{0}/messages/{1}' -X DELETE -H ... -H 'TE: Trailers' '''.format(chan, msg_id)
return os.system(curl)
while True:
del_msg(get_msg_id(chan))