正在写入项目,但正在发送空白文件

时间:2020-05-02 03:37:07

标签: python discord.py

在此代码中,文本文件被正确地写入,并且一切正常弹出,但是,当我最终将其发送出去之后,下载后文件中什么也没有出现,但是当我检查原始文件时,一切都已存在。

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   

0 个答案:

没有答案