You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
import logging
|
|
import os
|
|
|
|
from database.DB import get_engine
|
|
from discord_bot.discord_bot import DiscordBot
|
|
from log.Log import Log
|
|
|
|
# TODO use docker secrets instead of env variables
|
|
# TODO rework MINECRAFT_SERVER_DOMAIN env
|
|
|
|
# TODO create command /lookup_minecraft_name to see which discord account is associated with a minecraft name
|
|
# TODO make /lookup_minecraft_name only available to a configured role #2
|
|
|
|
def main():
|
|
Log.setup(os.environ.get('LOG'))
|
|
if not (len(os.environ.get('DISCORD_BOT_TOKEN')) > 0):
|
|
logging.getLogger("Main").critical("No discord bot token was found! Please generate a token at "
|
|
"https://discord.com/developers/applications/<your application id>/bot "
|
|
"and make sure it is present as the "
|
|
"environment variable \"DISCORD_BOT_TOKEN\".")
|
|
exit(1)
|
|
get_engine()
|
|
disc = DiscordBot()
|
|
disc.start_discord_bot(token=os.environ.get('DISCORD_BOT_TOKEN'), log_level=os.environ.get('LOG'))
|
|
|
|
if __name__ == "__main__":
|
|
main()
|