python_bot/sql.py

24 lines
495 B
Python
Raw Normal View History

import sqlite3 as sq
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)')
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, ?)')
db.commit()