randydev commited on
Commit
a780a6c
·
verified ·
1 Parent(s): 7801f49

Update chatbot/plugins/join_request.py

Browse files
Files changed (1) hide show
  1. chatbot/plugins/join_request.py +3 -1
chatbot/plugins/join_request.py CHANGED
@@ -107,7 +107,7 @@ async def join_request(client: Client, event: ChatJoinRequest):
107
  captcha_text, img_path, choices = generate_captcha_multiple_choice()
108
  captcha_texts[event.from_user.id] = captcha_text
109
  captcha_texts["chat_id"] = event.chat.id
110
- captcha_texts["username"] = event.from_user.username
111
  keyboard = InlineKeyboardMarkup(
112
  [
113
  [InlineKeyboardButton(choice, callback_data=f"verify_{event.from_user.id}_{choice}")]
@@ -213,6 +213,7 @@ async def verify_captcha_multiple_choice_callback(client: Client, cb: CallbackQu
213
  )
214
  del captcha_texts[user_id]
215
  del captcha_texts["chat_id"]
 
216
  else:
217
  await cb.edit_message_text("❌ Incorrect CAPTCHA. Please try again")
218
  logger.info(f"User {user_id} failed CAPTCHA verification.")
@@ -222,6 +223,7 @@ async def verify_captcha_multiple_choice_callback(client: Client, cb: CallbackQu
222
  )
223
  del captcha_texts[user_id]
224
  del captcha_texts["chat_id"]
 
225
 
226
  @Client.on_callback_query(filters.regex("^verify_captcha$"))
227
  async def verify_captcha_callback(client: Client, cb: CallbackQuery):
 
107
  captcha_text, img_path, choices = generate_captcha_multiple_choice()
108
  captcha_texts[event.from_user.id] = captcha_text
109
  captcha_texts["chat_id"] = event.chat.id
110
+ captcha_texts["chat_username"] = event.chat.username
111
  keyboard = InlineKeyboardMarkup(
112
  [
113
  [InlineKeyboardButton(choice, callback_data=f"verify_{event.from_user.id}_{choice}")]
 
213
  )
214
  del captcha_texts[user_id]
215
  del captcha_texts["chat_id"]
216
+ del captcha_texts["chat_username"]
217
  else:
218
  await cb.edit_message_text("❌ Incorrect CAPTCHA. Please try again")
219
  logger.info(f"User {user_id} failed CAPTCHA verification.")
 
223
  )
224
  del captcha_texts[user_id]
225
  del captcha_texts["chat_id"]
226
+ del captcha_texts["chat_username"]
227
 
228
  @Client.on_callback_query(filters.regex("^verify_captcha$"))
229
  async def verify_captcha_callback(client: Client, cb: CallbackQuery):