@@ -63,6 +63,10 @@ def test_handler(update: Update, context: CallbackContext):
63
63
pass
64
64
65
65
66
+ def delete_job (context :CallbackContext ):
67
+ context .job .context .delete ()
68
+
69
+
66
70
def reply_handler (update :Update ,context :CallbackContext ):
67
71
msg = update .effective_message
68
72
@@ -79,13 +83,14 @@ def reply_handler(update: Update, context: CallbackContext):
79
83
access_token = context .user_data .get ('access_token' )
80
84
81
85
if not access_token :
82
- msg .reply_text (f'Cannot reply to{ issue_type } , since you are not logged in. '
83
- f'Press button below to go to a private chat with me and login.\n \n '
84
- f'<i>This message will self destruct in 30 sec.</i>' ,
85
- reply_markup = InlineKeyboardMarkup ([[
86
- InlineKeyboardButton ('Login' ,url = deep_link (context .bot ,'login' ))
87
- ]]),
88
- parse_mode = ParseMode .HTML )
86
+ sent_msg = msg .reply_text (f'Cannot reply to{ issue_type } , since you are not logged in. '
87
+ f'Press button below to go to a private chat with me and login.\n \n '
88
+ f'<i>This message will self destruct in 30 sec.</i>' ,
89
+ reply_markup = InlineKeyboardMarkup ([[
90
+ InlineKeyboardButton ('Login' ,url = deep_link (context .bot ,'login' ))
91
+ ]]),
92
+ parse_mode = ParseMode .HTML )
93
+ context .job_queue .run_once (delete_job ,30 ,sent_msg )
89
94
return
90
95
91
96
if issue_type == 'issue' :