discord-akwah/main.py

23 lines
540 B
Python
Raw Normal View History

2020-11-13 01:49:39 +01:00
import logging
import sys
2020-11-13 15:51:12 +01:00
from os import listdir
2020-11-13 01:49:39 +01:00
2020-11-13 15:51:12 +01:00
from discord.ext.commands import Bot
from src.utils.config import build_config
2020-11-13 01:49:39 +01:00
2020-11-13 15:51:12 +01:00
# read config at configured location \\ default to 'config.ini'
config = build_config()
# spawn discord bot instance
2020-11-13 01:49:39 +01:00
# init token from config
2020-11-13 15:51:12 +01:00
bot = Bot(command_prefix="~ak ")
2020-11-13 01:49:39 +01:00
token = config['AUTH']['token']
2020-11-13 15:51:12 +01:00
# load extensions
for file in os.listdir("src/cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"src.cogs.{name}")
2020-11-13 01:49:39 +01:00
if __name__ == "__main__":
2020-11-13 15:51:12 +01:00
bot.run(token)