первый коммит
This commit is contained in:
29
app/handliers.py
Normal file
29
app/handliers.py
Normal file
@ -0,0 +1,29 @@
|
||||
import asyncio
|
||||
from aiogram import F, Router
|
||||
from aiogram.filters import CommandStart, Command
|
||||
from aiogram.types import Message, CallbackQuery
|
||||
from aiogram.enums import ParseMode
|
||||
import app.keyboard as kb
|
||||
import sqlite3
|
||||
|
||||
router = Router()
|
||||
|
||||
@router.message(CommandStart())
|
||||
async def cmd_start(message: Message):
|
||||
base = sqlite3.connect('users.db')
|
||||
|
||||
cur = base.cursor()
|
||||
|
||||
insert_user = """INSERT OR IGNORE INTO users (first_name, last_name, username, id, is_bot, is_premium)
|
||||
VALUES (?, ?, ?, ?, ?, ?)"""
|
||||
|
||||
val = (message.from_user.first_name, message.from_user.last_name, message.from_user.username,
|
||||
message.from_user.id, message.from_user.is_bot, message.from_user.is_premium)
|
||||
|
||||
cur.execute(insert_user, val)
|
||||
|
||||
base.commit()
|
||||
|
||||
base.close()
|
||||
|
||||
await message.answer("тестовый ответ")
|
0
app/keyboard.py
Normal file
0
app/keyboard.py
Normal file
Reference in New Issue
Block a user