-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (21 loc) · 881 Bytes
/
main.py
File metadata and controls
31 lines (21 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
from aiogram import types
from aiogram.utils import executor
from create_bot import dp
from aiogram.dispatcher.filters import Text
from handlers import client
from keyboards.start_kb import kb_start
from handlers.funcs import AnnounceAboutDeadlineAndLesson
active_session = False
async def on_startup(_):
print('Бот запущен')
@dp.message_handler(commands="start")
async def cm_start(message: types.Message):
await message.reply("Ты кто?", reply_markup=kb_start)
@dp.message_handler(Text("Выйти"))
async def cm(message: types.Message):
await message.answer("Ты кто?", reply_markup=kb_start)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.create_task(AnnounceAboutDeadlineAndLesson(15 * 60))
executor.start_polling(dp, skip_updates=True, on_startup=on_startup)