'Why is this sqlite trying to create a new column?
So I have this function called tag
def tag(name,response,creator):
#TAG CREATION
name = name.lower()
conn = sqlite3.connect('tags.db')
c = conn.cursor()
inp = "(\""+str(name)+"\",\""+str(response)+"\","+creator+")"
print(inp)
c.execute("INSERT INTO tags(name,response,creator) VALUES (?,?,?)",(name,response,creator))
conn.commit()
Now I use this function in a discord.py function which is basically invoking this function using discord
@bot.command()
async def create_tag(ctx,arg1,*,args):
try:
author = ctx.author.id
tag(arg1,args,author)
a = inf(arg1)
name = a[1]
content = a[2]
author = a[3]
embed=discord.Embed(title="Tag successfully created! ", description="Use the tag like this $tag" +str(name)+" to get this response"+str(content))
embed.set_thumbnail(url="https://c.tenor.com/kAmBOd5JWCkAAAAC/himouto-umaru-chan-umaru.gif")
await ctx.send(embed=embed)
except Exception as e:
await ctx.send(e)
print(e)
when this discord function is invoked it takes the given input along with it and uses tag function Now the thing is when I try to give an input to tag ( arg 1 = Sus ) giving input sus it tries to find a column named sus SORRY I WROTE TOTAL BS before also I have also tried awaiting the tag function where it then thinks that tag needs 2 arguements instead of 3 and then gives an error of extra arguement
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

