Fixed some issues before release
This commit is contained in:
@@ -185,18 +185,11 @@ class PlayerDBLinker:
|
||||
except:
|
||||
raise SQLInsertError()
|
||||
|
||||
def unlinkPlayer(self, minecraftname, discordid):
|
||||
def unlinkPlayer(self, discordid):
|
||||
# get uuid from server database -> check if in linkerdatabase
|
||||
serverdb_cursor = self.serverdbconn.get_cursor()
|
||||
discorddb_cursor = self.discorddbconn.get_cursor()
|
||||
sql = "SELECT playerUUID FROM playerprofiles WHERE playerName = '{}' LIMIT 1".format(minecraftname)
|
||||
serverdb_cursor.execute(sql)
|
||||
res = serverdb_cursor.fetchone()
|
||||
if res == None:
|
||||
raise WrongMinecraftName()
|
||||
playeruuid = res[0]
|
||||
if self.checkPlayerLink(playeruuid, discordid):
|
||||
sql2 = f"DELETE FROM {self.tablename} WHERE minecraftUUID = '{playeruuid}' AND discordid = '{discordid}'"
|
||||
if self.discordidused(discordid):
|
||||
sql2 = f"DELETE FROM {self.tablename} WHERE discordid = '{discordid}'"
|
||||
discorddb_cursor.execute(sql2)
|
||||
res2 = self.discorddbconn.get_db().commit()
|
||||
else:
|
||||
|
||||
@@ -21,4 +21,5 @@ modPlusRoles = [roleAdmin, roleMod, roleOwner]
|
||||
# Channels
|
||||
ModLogs = 760807882899193867
|
||||
#QuizChannelID_dev = 774418250665951232
|
||||
QuizChannelID = 774418250665951232
|
||||
QuizChannelID = 775776550871498752
|
||||
DiscordLinkerID = 776944220119760927
|
||||
|
||||
Reference in New Issue
Block a user