#๐Ÿ”’ Command 'registeraccount' raised an exception: OperationalError: no such column: kmanwastaken

5 messages ยท Page 1 of 1 (latest)

radiant spear
#

Trying to save information to a sqlite3 database via a command causes this error.

CODE:

@bot.tree.command(name="registeraccount", description="โš ๏ธ ONLY PERSONAL ACCOUNTS AS OF 5/5/24 โš ๏ธ Inserts your data into the MySQL database.")
@app_commands.describe(accountnumber = "Your LACB account number assigned to you when you applied.")
@app_commands.describe(amount = "The amount you have in your LACB account since you have applied.")
async def registeraccount(intergration:discord.Interaction, accountnumber: str, amount: str):
#     sql  = "INSERT INTO accounts (username, accountnum, amount) VALUES (%s, %s, %s)"
#     val = (intergration.user.name, accountnumber, amount)
#     c.execute(sql, val)
# ERROR IS IN THE LINE BELOW
      c.execute(f"INSERT INTO accounts (discordID, username, accountnum, amount) VALUES (%s, %s, %s, %s)" % (intergration.user.id, intergration.user.name, accountnumber, amount))
#      print(val)
      await intergration.response.send_message("Information gathered and logged successfully , thank you.")
spiral ploverBOT
#

@radiant spear

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

zealous granite
#

fyi you're misspelling integration but as long as it's consistent throughout your code it probably shouldn't be an issue

spiral ploverBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.