Huge cleanup and refactoring :>

This commit is contained in:
mrhanky
2017-08-22 17:43:48 +02:00
parent 7f5571fc09
commit f33a17038a
21 changed files with 127 additions and 185 deletions

15
bot/storage.py Normal file
View File

@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
import os
import psycopg2
from psycopg2.extras import DictCursor
from . import Plugin, Bot
class Storage(Plugin):
def __init__(self, bot: Bot):
super().__init__(bot)
self.bot.sql = self
self.con = psycopg2.connect(os.environ['DATABASE_URI'])
self.cur = self.con.cursor(cursor_factory=DictCursor)