From e7d48632f4320ed04e54763fd6dd065caf5b6211 Mon Sep 17 00:00:00 2001 From: Pavel_Duron Date: Mon, 7 Nov 2022 00:52:46 +1000 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 4 +++- dickpick.db | Bin 12288 -> 12288 bytes sql.py | 10 ++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index ca30425..e67ee15 100644 --- a/bot.py +++ b/bot.py @@ -2,10 +2,12 @@ from cgitb import text import datetime import logging from random import randint -import sqlite3 from aiogram import Bot, Dispatcher, executor, types from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton +#import sql + +#sql.db_start() API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w' diff --git a/dickpick.db b/dickpick.db index b1adb1b2f7093b3abdb39ecff4aa18ab131b06c0..451914551ba6c77e49b6164a865973b0e256d385 100644 GIT binary patch delta 20 bcmZojXh_&Flb^jfJ~KtZ({J+v{saX8QmzMB delta 20 bcmZojXh_&Flb=04Gesf9HDdDu{saX8QC0^( diff --git a/sql.py b/sql.py index 266114a..f882117 100644 --- a/sql.py +++ b/sql.py @@ -1,19 +1,16 @@ import sqlite3 as sq -async def db_start(): +async def db_start(): #подключение к бд global db, cur db = sq.connect('dickpick.db') cur = db.cursor() - cur.execute('CREATE TABLE IF NOT EXISTS users(users_id TEXT PRIMARY KEY, user_name TEXT, dick_size INT)') + cur.execute('CREATE TABLE IF NOT EXISTS users(id INTEGER PRIMARY KEY, users_id INTEGER, user_name TEXT, dick_size INTEGER)') db.commit() async def add_user(): - user_id = message.from_user.id - cur.execute('INSERT INTO users VALUES(users_id, ?, ?)') - user_name = message.from_user.full_name - cur.execute('INSERT INTO users VALUES(?, user_name, ?)') + cur.execute('INSERT INTO users (users_id, user_name) VALUES (?, ?,)'.format(message.from_user.id, message.from_user.fullname)) db.commit() @@ -21,3 +18,4 @@ async def add_user(): +