部署时Heroku Push上的Discord bot错误

时间:2019-08-12 18:51:17

标签: python heroku bots

我在不和谐的情况下制作了一个小机器人供个人使用,我想将其托管在Heroku上,但是我在部署应用程序时遇到了麻烦,代码在github上的私有存储库中

我已经制作了Procfilerequirement.txtruntime.txt 几个月前,我制作了另一个discord.py僵尸程序(discord.py的异步版本),并且使用了与现在想使用的相同的文件。

我的Procfileworker: python3 Main.py

我的requirements.txt

discord.py==1.2.3

我的runtime.txtpython-3.7.4

我的python代码

import os
import discord
from discord.ext import commands

client = commands.Bot(command_prefix = "/")
client.remove_command('help')

#Event

@client.event
async def on_ready():
    print("Kitsune Bot : Online")



for files in os.listdir('./cogs'):
    if files.endswith('.py'):
        try:
            client.load_extension(f'cogs.{files[:-3]}')
            print("{} is running !".format(files))
        except Exception as error:
            print(error)     



client.run(<myToken>)

预期结果是机器人上线并响应我的所有函数调用,但是在heroku上部署应用程序时,实际结果是错误:

-----> Installing python-3.7.4

-----> Installing pip

-----> Installing requirements with pip

 !     Push rejected, failed to compile Python app.

 !     Push failed```

1 个答案:

答案 0 :(得分:0)

要求必须是file而不是txt文件 您可以通过touch requirements

来完成
相关问题