Q: How do I get the update command to work? The rest of the script above works but update fails @commands.command()
@commands.cooldown(1, 8, commands.BucketType.user)
async def Beg(self, ctx):
    possibility = randint(1, 10)
    if possibility == 5:
        await ctx.send("I'll just give you this <:DiscordError:879192336960196619>")
    else:
        amount = randint(25, 175)
        outcomes = [f"If you're going to keep begging me I guess I'll give you ${amount}", f"How about you get a job for yourself? But I guess I'll give you ${amount}", f"I'll give you ${amount} but you owe me cuddles after this!", f"Let me see what's in my wallet.. Oh it's ${amount}! Take it!"]
        outcomes1 = random.choice(outcomes)
        await ctx.send(outcomes1)
        db = sqlite3.connect("main.sqlite")
        cursor = db.cursor()
        result = cursor.fetchone()
        sql = f"UPDATE main SET money = * WHERE member_id = {ctx.message.author.id}"
        val = (result[1] + amount)
        cursor.execute(sql, val)
        db.commit()
        await ctx.send("Sent!")
        cursor.close()
        db.close()

As I said, the update command doesn't work. The outcome messages works fine. It get's sent, nothing get's updated.

A: As a best practice, I recommend moving all ctx confirmation messages to the end of the function. I prefer it that way, because it'll help serve as a sort of debugging (if all prior steps are successful, then a confirmation message is sent).
I recommend removing cursor.close() as that method isn't applicable to the cursor object. You open and close the database connection, not the cursor.
result[1] should be result[0], as well. Without knowing how your db is set up, it also might be worthwhile to ensure that result[0] is an integer before trying to do math on it.
