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 a16f3a6..c5329d2 100644 Binary files a/user.db and b/user.db differ