-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (19 loc) · 781 Bytes
/
main.py
File metadata and controls
25 lines (19 loc) · 781 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
from keyboards import get_main_menu
from constants import ONBOARDING
from database import Database
from controller.controller import Controller
from telegram_viewer import TelegramViewer, bot
@bot.message_handler(commands=['start'])
def start_message(message):
TelegramViewer().view(message.chat.id, ONBOARDING['en'], get_main_menu('en'))
@bot.message_handler(content_types='text')
def message_reply(message):
db = Database()
viewer = TelegramViewer()
Controller(db, viewer).operate(str(message.chat.id), message.text)
@bot.callback_query_handler(func=lambda call: True)
def callback_reply(call):
db = Database()
viewer = TelegramViewer()
Controller(db, viewer).callback(str(call.from_user.id), call.message.message_id, call.data)
print(call)