Skip to content

CorleoneXin/GanDao_Bot

Repository files navigation

GanDao_Bot

参考链接:

目前先试试不做webApp吧,直接去botFather创建一个bot。重命名.env.example为.env 然后填再.env文件就可以自己开发了

Run the Bot

  • Make sure poetry is installed on your system.

将依赖安装在目录下,这样vscode就能检测到了 poetry config virtualenvs.in-project true

poetry install

Dev mode

  • Run: poetry run python -m src.main --dev or execute the main function directly in your debugger which will default to dev mode. (make sure the environment is activated by running poetry shell first)

Production mode

Production mode runs alembic migrations against your database before starting the bot, make sure the following environment variables are set:

  • BOT_TOKEN you can get one from Botfather
  • DB_PATH the path to your database, relative from where the bot is executing. (I recommend choosing /data/yourdb.sqlite3, as a /data directory is automatically created in the Docker container and can be mounted to a persistent volume)
  • FIRST_ADMIN your telegram_id, this can be set to give you automatically the ADMIN role when you register in your own bot

The following are optional:

  • LOGGING_CHANNEL a telegram chat_id that the ErrorForwarder can use to send JSON logs to. Very useful, usually set to a shared channel or your own id.

Finally:

  • Execute ./entrypoint.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published