diff options
-rw-r--r-- | modules/anidb.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/anidb.py b/modules/anidb.py index 5a3633d..9a4ba47 100644 --- a/modules/anidb.py +++ b/modules/anidb.py @@ -20,7 +20,7 @@ for option in ('username', 'password'): class Module: def __init__(self, bot): self.irc = bot - self.db = PgSQL.connect() + self.db = PgSQL.connect(database = 'fot') def get_aid(self, msg, short = False): if msg.isdigit(): @@ -32,9 +32,9 @@ class Module: search = '%%%s%%' % search cur = self.db.cursor() if short: - cur.execute('select * from anidb.anidb where aid in (select distinct aid from anidb.anidb where title ~~* %s and type in (2, 3)) and type = 1', (search,)) + cur.execute('select * from anidb where aid in (select distinct aid from anidb where title ~~* %s and type in (2, 3)) and type = 1', (search,)) else: - cur.execute('select * from anidb.anidb where aid in (select distinct aid from anidb.anidb where title ~~* %s) and type = 1', (search,)) + cur.execute('select * from anidb where aid in (select distinct aid from anidb where title ~~* %s) and type = 1', (search,)) r = cur.fetchall() cur.close() return [(r[0][0], r[0][3])] if len(r) == 1 else [(x[0], x[3]) for x in r] |