16 lines
360 B
Python
16 lines
360 B
Python
# -*- 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)
|