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//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()