fixed sql inser on twitch / yt and mc update
This commit is contained in:
parent
dd218a6509
commit
537310fe12
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -84,7 +84,7 @@ async def mc(ctx, minecraftUsername : str):
|
|||
cursor = db.cursor()
|
||||
cursor.execute("SELECT * FROM users WHERE discord=%s", (ctx.author.id))
|
||||
if(len(cursor.fetchall()) == 0):
|
||||
cursor.execute("INSERT INTO users (discord, mcuuid) VALUES (%s, %s)", (ctx.author, respone["uuid"]))
|
||||
cursor.execute("INSERT INTO users (discord, mcuuid) VALUES (%s, %s)", (ctx.author.id, respone["uuid"]))
|
||||
else:
|
||||
cursor.execute("UPDATE users SET mcuuid=%s WHERE discord=%s", (respone["uuid"], ctx.author.id))
|
||||
db.commit()
|
||||
|
@ -98,7 +98,7 @@ async def yt(ctx, youTubeChannelURL):
|
|||
cursor = db.cursor()
|
||||
cursor.execute("SELECT * FROM users WHERE discord=%s", (ctx.author.id))
|
||||
if(len(cursor.fetchall()) == 0):
|
||||
cursor.execute("INSERT INTO users (discord, ytchannel) VALUES (%s, %s)", (ctx.author, youTubeChannelURL))
|
||||
cursor.execute("INSERT INTO users (discord, ytchannel) VALUES (%s, %s)", (ctx.author.id, youTubeChannelURL))
|
||||
else:
|
||||
cursor.execute("UPDATE users SET ytchannel=%s WHERE discord=%s", (youTubeChannelURL, ctx.author.id))
|
||||
db.commit()
|
||||
|
@ -112,7 +112,7 @@ async def twitch(ctx, twitchChannelURL):
|
|||
cursor = db.cursor()
|
||||
cursor.execute("SELECT * FROM users WHERE discord=%s", (ctx.author.id))
|
||||
if(len(cursor.fetchall()) == 0):
|
||||
cursor.execute("INSERT INTO users (discord, twchannel) VALUES (%s, %s)", (ctx.author, twitchChannelURL))
|
||||
cursor.execute("INSERT INTO users (discord, twchannel) VALUES (%s, %s)", (ctx.author.id, twitchChannelURL))
|
||||
else:
|
||||
cursor.execute("UPDATE users SET twchannel=%s WHERE discord=%s", (twitchChannelURL, ctx.author.id))
|
||||
db.commit()
|
||||
|
|
Loading…
Reference in a new issue