Fix incorrect user being fetched

This commit is contained in:
Noi 2020-03-01 13:59:20 -08:00
parent d355cd9d8f
commit 82f956f47a

View file

@ -61,21 +61,21 @@ class UserDatabase:
self.db.commit() self.db.commit()
c.close() c.close()
def get_user(self, serverid, usreid): def get_user(self, serverid, userid):
''' '''
Retrieves the time zone name of a single user Retrieves the time zone name of a single user
''' '''
c = self.db.cursor() c = self.db.cursor()
c.execute(""" c.execute("""
SELECT zone FROM userdata SELECT zone FROM userdata
WHERE guild_id = %s WHERE guild_id = %s and user_id = %s
""", (serverid,)) """, (serverid, userid))
result = c.fetchone() result = c.fetchone()
c.close() c.close()
if result is None: return None if result is None: return None
return result[0] return result[0]
def get_list(self, serverid, userid=None): def get_list(self, serverid, userid=None):
''' '''
Retrieves a list of recent time zones based on Retrieves a list of recent time zones based on