Made sure that all messages within the channel are stored in the file before getting deleted

pull/8/head
sgoudham 4 years ago
parent 7750c5092e
commit c6b93cf931

@ -654,7 +654,7 @@ class Guild(Cog):
# Store all text in the channel in a bytesio object # Store all text in the channel in a bytesio object
text = "" text = ""
async for message in user_channel.history(limit=300): async for message in user_channel.history(limit=300):
text = "".join(f"{message.created_at} : {message.content}\n") text += "".join(f"{message.created_at} : {message.content}\n")
text_bytes = str.encode(text) text_bytes = str.encode(text)
file = io.BytesIO(text_bytes) file = io.BytesIO(text_bytes)

Loading…
Cancel
Save