Answer the question
In order to leave comments, you need to log in
How to create a new record in a table?
So the thing is: I just recently started with databases and it is necessary that when a player
enters
the server, a separate entry in the table is created for him
@commands.Cog.listener()
async def on_member_join(self, member):
conn = sqlite3.connect(f"Servers.db")
cursor = conn.cursor()
cursor.execute(f"""INSERT INTO '{member.guild.name}'
('{member.name}')
""")
conn.commit()
Answer the question
In order to leave comments, you need to log in
How to create a new record in a table?
cursor.execute(f"""INSERT INTO '{member.guild.name}'
('{member.name}')
""")
INSERT INTO table (column1,column2 ,..)
VALUES( value1, value2 ,...);
and if you make a public bot, how to save, for example, warnings for each ds server? I just wanted to make levels.
it is necessary that when a player enters the server, a separate table is created for him
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question