好吧,我正在尝试制作一个 Discord.py 机器人。我做到了,但现在我无法主持它。当我尝试(在 Heroku 上)时,测功机从未出现。这是 GitHub 链接:https://github.com/EchoNoahGaming/echobot/
我原以为它会有 Dyno,但没有。
Procfile 中只有“worker: pybot.py”,并且在日志中显示
2019-04-07T17:07:09.025914+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=echobotyeet.herokuapp.com request_id=1330f84d-51a4-4462-9de1-cbea09bc621b fwd="172.6.17.203" dyno= connect= service= status=502 bytes= protocol=https
2019-04-07T17:07:11.185818+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=echobotyeet.herokuapp.com request_id=93b077ec-61de-4e5f-b7e3-e9e2a0674546 fwd="172.6.17.203" dyno= connect= service= status=502 bytes= protocol=https
一些主要的机器人是
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.command()
async def announcement(ctx, *, args):
"""Announcement command!"""
embed=discord.Embed(title="Announcement", description=args, color=0x7700aa)
embed.set_footer(text="By EchoNoahGaming")
await ctx.send("@everyone", embed=embed)
client.run(str(os.environ.get('BOT_TOKEN')))
最佳答案
您的Procfile
定义不正确,请将其worker: pybot.py
更改为-->
worker: python pybot. py
此外,在您的 requirements.txt
中,它应该只是未作为 Python 默认安装的模数名称以及您需要的名称。
关于python - 如何修复 Heroku Dyno 不显示的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55561981/