I am making a python code that purges a users messages. The only problem is when it writes to file it replaces and deletes the previous code Example:
https://cdn.upload.systems/uploads/ZTjM7EON.gif
Current Code:
async for mss in channel.history(limit=None):
if logmsgs == "True":
f = open("LoggedMessages.txt","w",encoding="utf-8")
f.writelines(mss.content + "\n")
f.close()