-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (22 loc) · 756 Bytes
/
main.py
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
32
33
34
35
from bot import *
import core
# accessible only for admins
@dp.message_handler(commands=['post', 'get_users', 'get_database'])
async def admin_commands(msg: Message):
if msg.from_user.id in ADMIN_ID:
await core.on_start(msg)
@dp.message_handler(commands=['start'])
async def on_start(msg: Message):
await core.on_start(msg)
@dp.message_handler(content_types=['text'])
async def on_message(msg: Message):
await core.on_message(msg)
@dp.message_handler(content_types=['phone'])
async def on_phone(msg: Message):
await core.on_phone(msg)
@dp.callback_query_handler()
async def on_callback(msg: CallbackQuery):
await core.on_callback(msg)
if __name__ == '__main__':
print('Started!')
executor.start_polling(dp)