randydev commited on
Commit
2807d9f
·
verified ·
1 Parent(s): 27cf193

Update chatbot/plugins/join_request.py

Browse files
Files changed (1) hide show
  1. chatbot/plugins/join_request.py +7 -1
chatbot/plugins/join_request.py CHANGED
@@ -170,8 +170,14 @@ def failed_hacker_by_randydev():
170
  async def remove_captcha_after_timeout(client, user_id, delay=300):
171
  await asyncio.sleep(delay)
172
  if user_id in captcha_texts:
173
- del captcha_texts[user_id]
 
 
 
 
 
174
  await client.send_message(user_id, "⏰ Your CAPTCHA verification has expired. Please try again.")
 
175
  logger.info(f"CAPTCHA for user {user_id} has expired and been removed.")
176
 
177
  @Client.on_message(filters.command("settingmode") & filters.private)
 
170
  async def remove_captcha_after_timeout(client, user_id, delay=300):
171
  await asyncio.sleep(delay)
172
  if user_id in captcha_texts:
173
+ captcha_data = captcha_texts.get(user_id)
174
+ chat_id = captcha_data['chat_id']
175
+ await client.decline_chat_join_request(
176
+ chat_id=chat_id,
177
+ user_id=user_id
178
+ )
179
  await client.send_message(user_id, "⏰ Your CAPTCHA verification has expired. Please try again.")
180
+ del captcha_texts[user_id]
181
  logger.info(f"CAPTCHA for user {user_id} has expired and been removed.")
182
 
183
  @Client.on_message(filters.command("settingmode") & filters.private)