Answer the question
In order to leave comments, you need to log in
How to make a Bot in the database in the id list automatically give the id?
The essence of the question is what is the database there is a cell under id. There is a command to add a user to the database !data add (NAME) (NIC) (DISCORD) (REG DATE) (ID). It is necessary that the id be issued automatically, for example:
('Egor', 'Proper12_pro', 'EpofTry#6230', '21', '23-05-2021 17:09', ID-->'1'),
('Egor ', 'Proper12_pro', 'EpofTry#6230', '21', '23-05-2021 17:09', ID-->'2'),
('Egor', 'Proper12_pro', 'EpofTry#6230' , '21', '23-05-2021 17:09', ID-->'3'),
but id does not need to be written.
@bot.command()
async def data(ctx, *args):
if len(args) == 0:
await ctx.send(f'{ctx.author.name}, не хватает агругумента')
elif args[0] == 'add':
now = datetime.datetime.now()
RegTime = now.strftime("%d-%m-%Y %H:%M")
base.execute('INSERT INTO data VALUES(?, ?, ?, ?, ?, ?)', (args[1], args[2], args[3], args[4], RegTime, "Тут авто id"))
base.commit()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question