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:
|
||||
|
||||
Reference in New Issue
Block a user