Huge cleanup and refactoring :>
This commit is contained in:
15
bot/storage.py
Normal file
15
bot/storage.py
Normal 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)
|
||||
Reference in New Issue
Block a user