From 8563b50aa384d0937c8ed8e9784db87b83c3fc23 Mon Sep 17 00:00:00 2001 From: Slava Date: Sat, 18 Jun 2022 11:18:02 +0300 Subject: [PATCH] up db test --- test.py | 10 ++++------ user.db | Bin 28672 -> 28672 bytes 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test.py b/test.py index 00eb250..07844d5 100644 --- a/test.py +++ b/test.py @@ -6,7 +6,6 @@ import sqlite3 from discord.ext import commands from dislash import InteractionClient, Option, OptionType -from discord import app_commands def insert_varible_into_table(name, userid, isbot, nick, guild): @@ -50,7 +49,8 @@ def _read_db(guildid, user): try: sql_con = sqlite3.connect("user.db") cursor = sql_con.cursor() - sql_read = f"""SELECT * FROM "{guildid}" where userid = {user.removesuffix('>').removeprefix('<@')}""" + print(user) + sql_read = f"""SELECT * FROM "{guildid}" where userid = {user}""" cursor.execute(sql_read) record = cursor.fetchone() if record[4] is None: @@ -111,10 +111,8 @@ async def test(ctx, user): Option("user", "Specify any user", OptionType.USER), ] ) -async def hello(ctx, user, interaction: discord.Interaction): - await interaction.deferReply() - result = await _read_db(ctx.guild.id, user) - await ctx.send(result) +async def hello(ctx, user): + await ctx.send(_read_db(ctx.guild.id, user.id)) # await ctx.send(_read_db(ctx.guild.id, user)) diff --git a/user.db b/user.db index a16f3a6ec6eb9b6b442af267fef050331211d35a..c5329d2ba46cf67347f924fa61d60399dca4d7bb 100644 GIT binary patch delta 30 lcmZp8z}WDBae_2s?nD`9#@vkw(($Y%MX5!pn;YUA1OTmR3l0DP delta 28 kcmZp8z}WDBae_2s&O{k!#+;1_((#k4^*J}U#McM_0GQ(nD*ylh