forked from Pavel_Durov/python_bot
тест
This commit is contained in:
parent
0f4b4caed0
commit
e7d48632f4
4
bot.py
4
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'
|
||||
|
||||
|
BIN
dickpick.db
BIN
dickpick.db
Binary file not shown.
10
sql.py
10
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():
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user