python - 如何修复 Heroku Dyno 不显示的问题?

标签 python heroku discord.py

好吧,我正在尝试制作一个 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/

相关文章:

python - 依赖 apt 库构建 conda 包

python - 如何使用 Boto3 Python 在 S3 中创建 zipfile?

python - 如何检查用户是否提供了参数 discord.py

Python Discord 在命令后获取多条消息

python - 按列分组统计不同的连续行

python - Tkinter 单选按钮奇怪的外观

python - Python从列表中删除大于阈值的元素

python - Celery 为生产者和消费者配置单独的连接

python - 在 Heroku 上找不到资源 'corpora/wordnet'

python-3.x - discord bot -- IndexError : list index out of range