Add default value for bot_token

This commit is contained in:
2022-01-03 15:10:06 +01:00
parent 1b6a212d72
commit 9ac6c995f8

View File

@ -8,9 +8,11 @@ from dotenv import load_dotenv
load_dotenv(verbose=True) load_dotenv(verbose=True)
sqlite_location = os.getenv("SQLITE_LOCATION", default="/jobs.sqlite") sqlite_location = os.getenv("SQLITE_LOCATION", default="/jobs.sqlite")
config_timezone = os.getenv("TIMEZONE", default="Europe/Stockholm") config_timezone = os.getenv("TIMEZONE", default="Europe/Stockholm")
bot_token = os.getenv("BOT_TOKEN") bot_token = os.getenv("BOT_TOKEN", default="")
log_level = os.getenv(key="LOG_LEVEL", default="INFO") log_level = os.getenv(key="LOG_LEVEL", default="INFO")
if not bot_token:
raise ValueError("Missing bot token")
# Advanced Python Scheduler # Advanced Python Scheduler
jobstores = {"default": SQLAlchemyJobStore(url=f"sqlite://{sqlite_location}")} jobstores = {"default": SQLAlchemyJobStore(url=f"sqlite://{sqlite_location}")}