when people take my code but put it in the wrong place and fuck it up

This commit is contained in:
depreciate 2019-03-02 03:59:28 +10:30
parent 8618d1cf5c
commit 6f08305254
1 changed files with 12 additions and 0 deletions

View File

@ -1648,3 +1648,15 @@ def updateAchievementsVersion(userID):
glob.db.execute("UPDATE users SET achievements_version = %s WHERE id = %s LIMIT 1", [
glob.ACHIEVEMENTS_VERSION, userID
])
def getClan(userID):
"""
Get userID's clan
:param userID: user id
:return: username or None
"""
clanInfo = glob.db.fetch("SELECT clans.tag, clans.id, user_clans.clan, user_clans.user FROM user_clans LEFT JOIN clans ON clans.id = user_clans.clan WHERE user_clans.user = %s LIMIT 1", [userID])
username = getUsername(userID)
if clanInfo is None:
return username
return "[" + clanInfo["tag"] + "] " + username