在此代码中,文本文件被正确地写入,并且一切正常弹出,但是,当我最终将其发送出去之后,下载后文件中什么也没有出现,但是当我检查原始文件时,一切都已存在。
my_files = [
discord.File('anime_spam.txt')
]
if eplist > 12:
await ctx.send("Uh Oh Looks like there are too many episodes so they have been saved to a text file. This is to avoid spam.")
while True:
eplist -=1
title = episodes[eplist]
eps = title.text.strip()
anime_spam.write("Episode:" + " " + eps + "\n")
if eplist == 0:
await ctx.send(files=my_files)
time.sleep(3)
break