-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandlers.py
50 lines (38 loc) · 1.28 KB
/
handlers.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from messages import Messages
from interactives import *
from form import *
class Handler:
def __init__(self, message_type, chat_id, message_data, token, update_body):
self.message_type = message_type
self.chat_id = chat_id
self.message_data = message_data
self.bot_token = token
self.update = update_body
def run(self):
{'join': self.join_member_handler(),
'leave': self.leave_member_handler(),
'text': self.text_message_handler(),
'contact': self.contact_message_handler(),
'location': self.location_message_handler(),
'submitForm': self.form_handler(),
'triggerButton': self.button_handler(),
'paycallback': self.payment_handler(),
'invoicecallback': self.bill_handler()}.get(self.message_type)
def join_member_handler(self):
pass # todo: save for analyze
def leave_member_handler(self):
pass # todo: save for analyze
def text_message_handler(self):
pass
def contact_message_handler(self):
pass
def location_message_handler(self):
pass
def form_handler(self):
pass
def button_handler(self):
pass
def payment_handler(self):
pass
def bill_handler(self):
pass