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()
c.close()
def get_user(self, serverid, usreid):
def get_user(self, serverid, userid):
'''
Retrieves the time zone name of a single user
'''
c = self.db.cursor()
c.execute("""
SELECT zone FROM userdata
WHERE guild_id = %s
""", (serverid,))
WHERE guild_id = %s and user_id = %s
""", (serverid, userid))
result = c.fetchone()
c.close()
if result is None: return None
return result[0]
def get_list(self, serverid, userid=None):
'''
Retrieves a list of recent time zones based on