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 b1adb1b..4519145 100644 Binary files a/dickpick.db and b/dickpick.db differ 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(): +