From ddc0968a2b39fe46c7abaf3ecdc526a64677fdcd Mon Sep 17 00:00:00 2001 From: Ev-1 <33662061+Ev-1@users.noreply.github.com> Date: Fri, 22 Mar 2019 16:19:59 +0100 Subject: [PATCH] Added bot.session and bot.APIkeys --- bot.py | 8 +++++++- data/config.yaml.example | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 704503c..c126857 100644 --- a/bot.py +++ b/bot.py @@ -4,6 +4,7 @@ import time import sys import traceback import yaml +import aiohttp from discord.ext import commands from discord.ext.commands.view import StringView @@ -17,7 +18,7 @@ from cogs.utils.paginator import Scroller with codecs.open("data/config.yaml", 'r', encoding='utf8') as f: - conf = yaml.safe_load(f) + conf = yaml.load(f, Loader=yaml.SafeLoader) initial_extensions = [ @@ -48,8 +49,13 @@ class Bot(commands.Bot): description=conf["bot"]["description"]) self.settings = Settings(**conf['default server settings']) + self.APIkeys = conf.get('APIkeys', {}) + self.localizer = Localizer(conf.get('locale path', "./localization"), conf.get('locale', 'en_en')) self.aliaser = Aliaser(conf.get('locale path', "./localization"), conf.get('locale', 'en_en')) + + self.session = aiohttp.ClientSession(loop=self.loop) + self.debug = debug for extension in initial_extensions: diff --git a/data/config.yaml.example b/data/config.yaml.example index f314103..88402be 100644 --- a/data/config.yaml.example +++ b/data/config.yaml.example @@ -29,4 +29,8 @@ lavalink nodes: port: 2333 password: youshallnotpass region: eu - name: backup-1 \ No newline at end of file + name: backup-1 + +APIkeys: + genius: + youtube: