Spaces:
Running
Running
Update chatbot/plugins/join_request.py
Browse files
chatbot/plugins/join_request.py
CHANGED
@@ -8,6 +8,7 @@ import re
|
|
8 |
import logging
|
9 |
import string
|
10 |
import random
|
|
|
11 |
from pyrogram import *
|
12 |
from pyrogram.types import *
|
13 |
from pyrogram.errors import *
|
@@ -31,6 +32,14 @@ logger = logging.getLogger(__name__)
|
|
31 |
user_list = []
|
32 |
captcha_texts = {}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
async def remove_captcha_after_timeout(client, user_id, delay=300):
|
35 |
await asyncio.sleep(delay)
|
36 |
if user_id in captcha_texts:
|
@@ -191,8 +200,10 @@ async def verify_captcha_multiple_choice_callback(client: Client, cb: CallbackQu
|
|
191 |
correct_captcha = captcha_texts.get(user_id)
|
192 |
logger.info(f"User {user_id} selected CAPTCHA: {user_choice} (Expected: {correct_captcha})")
|
193 |
if user_choice == correct_captcha:
|
194 |
-
|
195 |
-
|
|
|
|
|
196 |
reply_markup=create_button_join_group(captcha_texts.get("username"))
|
197 |
)
|
198 |
logger.info(f"User {user_id} successfully verified CAPTCHA.")
|
|
|
8 |
import logging
|
9 |
import string
|
10 |
import random
|
11 |
+
import requests
|
12 |
from pyrogram import *
|
13 |
from pyrogram.types import *
|
14 |
from pyrogram.errors import *
|
|
|
32 |
user_list = []
|
33 |
captcha_texts = {}
|
34 |
|
35 |
+
def thanks_hacker_by_randydev():
|
36 |
+
url = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR0u8UqJ2JDhfmPOCb_zAHjUQG2NYMjTwLbkq_sQhCQOxX8hn66YbaGFvLL&s=10"
|
37 |
+
response = requests.get(url)
|
38 |
+
image_hacker = "hacker.png"
|
39 |
+
with open(image_hacker, "wb") as f:
|
40 |
+
f.write(response.content)
|
41 |
+
return image_hacker
|
42 |
+
|
43 |
async def remove_captcha_after_timeout(client, user_id, delay=300):
|
44 |
await asyncio.sleep(delay)
|
45 |
if user_id in captcha_texts:
|
|
|
200 |
correct_captcha = captcha_texts.get(user_id)
|
201 |
logger.info(f"User {user_id} selected CAPTCHA: {user_choice} (Expected: {correct_captcha})")
|
202 |
if user_choice == correct_captcha:
|
203 |
+
hacker_image = thanks_hacker_by_randydev()
|
204 |
+
await cb.answer("✅ CAPTCHA verification successful!", show_alert=True)
|
205 |
+
await cb.edit_message_media(
|
206 |
+
media=InputMediaPhoto(hacker_image),
|
207 |
reply_markup=create_button_join_group(captcha_texts.get("username"))
|
208 |
)
|
209 |
logger.info(f"User {user_id} successfully verified CAPTCHA.")
|