@@ -26,6 +26,7 @@ def execute(self):
26
26
cmd = None
27
27
specificConfig = self .config .get ('SpecificConfig' )
28
28
chat_ids = SetPersist ('chat_ids' )
29
+ callback_short_report = '5m'
29
30
30
31
if not specificConfig :
31
32
@@ -51,7 +52,7 @@ def start(update: Update, context: CallbackContext):
51
52
# buttonb = KeyboardButton()
52
53
# keyboard = [[keyboardButton]]
53
54
# reply_markup = ReplyKeyboardMarkup(keyboard)
54
- data_short_report = 'A unique text for help button callback data '
55
+ data_short_report = '5m '
55
56
report_button = InlineKeyboardButton (
56
57
text = 'Request Report: 5min' , # text that show to user
57
58
callback_data = data_short_report # text that send to bot when user tap button
@@ -75,11 +76,17 @@ def message(update, context):
75
76
def callback_query_handler (update , context ):
76
77
77
78
data = update .callback_query .data
78
- context .bot .answer_callback_query (
79
- callback_query_id = update .callback_query .id ,
80
- text = 'Preparing report...'
81
- )
79
+ if data == callback_short_report :
80
+
81
+ context .bot .answer_callback_query (
82
+ callback_query_id = update .callback_query .id ,
83
+ text = 'Preparing report...'
84
+ )
82
85
86
+ guitext = GuiCMD ('Report request from: {}' .format (update .callback_query .from_user .first_name ))
87
+ self .return_queue .put (guitext )
88
+ record = Record (data , 'Report request from: {}' .format (update .callback_query .from_user .first_name ))
89
+ self .return_queue .put (record )
83
90
84
91
85
92
start_handler = CommandHandler ('start' , start ) # handler for the start command
0 commit comments