better DISCORD_TOKEN error

This commit is contained in:
AF 2023-08-30 20:58:47 +00:00
parent f62f2496df
commit 30c9186385

View File

@ -13,7 +13,15 @@ from .db import AbstractDbFactory
async def _main():
token = os.getenv("DISCORD_TOKEN")
assert token is not None
if token is None:
print(
"""\
DISCORD_TOKEN environment variable is not set
edit .secrets/starbot.env with the following content (substitute <token here> with the token):
DISCORD_TOKEN = <token here>\
"""
)
exit(1)
dbfm = os.getenv("DBF_MODULE")
assert dbfm is not None
DBF: AbstractDbFactory = importlib.import_module(dbfm).DBF