1
0
Fork 0

Add bot.py

This commit is contained in:
Trueold89 2024-09-04 19:45:29 +03:00
parent 4b09cd91b5
commit cf06f20076
1 changed files with 32 additions and 0 deletions

32
u232ping/bot.py Normal file
View File

@ -0,0 +1,32 @@
from os import environ
from aiogram import Bot, Dispatcher
from aiogram.client.default import DefaultBotProperties
from aiogram.enums import ParseMode
from aiogram.filters import Command
from aiogram.types import Message
from u232ping.db import Sqlite
from u232ping.controller import Controller
TOKEN = environ["BOT_TOKEN"]
dp = Dispatcher()
c = Controller(Sqlite())
@dp.message(Command("all"))
async def all(message: Message) -> None:
await c.all(message)
@dp.message(Command("1"))
async def first(message: Message) -> None:
await c.first(message)
@dp.message(Command("2"))
async def second(message: Message) -> None:
await c.second(message)
async def main() -> None:
bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
await dp.start_polling(bot)