【问题标题】:How to share Discord.py code with Github without exposing code, while still having your bot run on Heroku如何在不暴露代码的情况下与 Github 共享 Discord.py 代码,同时仍然让你的机器人在 Heroku 上运行
【发布时间】:2021-01-12 07:18:48
【问题描述】:

所以我在 Heroku 上托管了我的 Discord.py 机器人。我还想继续更新 Github 上的源代码。每当我想更新源代码时,我必须删除包含令牌的 .env 文件,以便将其上传到 Github,然后我必须再次添加文件 以将其推送到赫罗库。有什么方法可以让机器人在 Heroku 上运行,而不必在这样做之前将文件添加到 Git?

【问题讨论】:

    标签: github heroku discord bots discord.py


    【解决方案1】:

    您可以将令牌作为配置变量存储在 Heroku 中,它会自动将其设置为 Dyno 中的环境变量,您根本不需要 .env 文件。

    见:https://devcenter.heroku.com/articles/config-vars

    【讨论】:

      猜你喜欢
      • 2012-05-02
      • 1970-01-01
      • 2010-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-23
      • 2023-01-30
      相关资源
      最近更新 更多