"""Start the Discord bot and connect to Discord."""
import importlib
import logging

import hitomi.config as config
from hitomi import bot

logger = logging.getLogger(__name__)


def run_bot():
    """Initialize plugins and begin the bot."""
    for plugin in config.BOT_PLUGINS:
        importlib.import_module(plugin)

    bot.run(config.BOT_TOKEN)


if __name__ == '__main__':
    run_bot()