.BANCHO. Add notification when donor tag is expiring soon
This commit is contained in:
@@ -626,4 +626,15 @@ def cacheUserIDs():
|
||||
"""Cache userIDs in glob.userIDCache, used later with getID()."""
|
||||
data = glob.db.fetchAll("SELECT id, username FROM users WHERE privileges & {} > 0".format(privileges.USER_NORMAL))
|
||||
for i in data:
|
||||
glob.userIDCache[i["username"]] = i["id"]
|
||||
glob.userIDCache[i["username"]] = i["id"]
|
||||
|
||||
def getDonorExpire(userID):
|
||||
"""
|
||||
Return userID's donor expiration UNIX timestamp
|
||||
:param userID:
|
||||
:return: donor expiration UNIX timestamp
|
||||
"""
|
||||
data = glob.db.fetch("SELECT donor_expire FROM users WHERE id = %s LIMIT 1", [userID])
|
||||
if data is not None:
|
||||
return data["donor_expire"]
|
||||
return 0
|
Reference in New Issue
Block a user