K
K
Kirill Kochurov2020-07-11 08:56:58
Python
Kirill Kochurov, 2020-07-11 08:56:58

Question about sqlite3 and discord.py?

krch when i write one cmd to show user balance using sqlite3
i get no error no message code:

client.command( aliases = [ 'balance', 'cash' ])
async def __balance(ctx, member: discord.Member = None):
if member is None:
await cyx.send(embed = discord.Embed(description = f""" Баланс позьзователя **{ctx.author}** состовляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(ctx.author.id)).fetchone()[0]}** """))

else:
await cyx.send(embed = discord.Embed(description = f""" Баланс позьзователя **{member}** состовляет **{cursor.execute("SELECT cash FROM users WHERE id = {}".format(member.id)).fetchone()[0]}** """))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-07-11
@bacon

Krch no need to code like shit, take out work from the database from the f-line and do normal checks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question