Spaces:
Running
Running
Update chatbot/plugins/join_request.py
Browse files
chatbot/plugins/join_request.py
CHANGED
@@ -21,6 +21,16 @@ logger = logging.getLogger(__name__)
|
|
21 |
captcha_texts = {}
|
22 |
captcha_modes = {}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
def generate_math_captcha():
|
25 |
operations = ['+', '-', '*']
|
26 |
operation = random.choice(operations)
|
@@ -182,6 +192,8 @@ async def remove_captcha_after_timeout(client, user_id, delay=300):
|
|
182 |
|
183 |
@Client.on_message(filters.command("settingmode") & filters.private)
|
184 |
async def setting_mode(client: Client, message: Message):
|
|
|
|
|
185 |
user_id = message.from_user.id
|
186 |
keyboard = InlineKeyboardMarkup(
|
187 |
[
|
@@ -321,6 +333,9 @@ async def verify_captcha_callback(client: Client, cb: CallbackQuery):
|
|
321 |
reply_markup=create_button_join_group(chat_link)
|
322 |
)
|
323 |
logger.info(f"User {user_id} berhasil memverifikasi CAPTCHA.")
|
|
|
|
|
|
|
324 |
await client.approve_chat_join_request(
|
325 |
chat_id=chat_id,
|
326 |
user_id=user_id
|
|
|
21 |
captcha_texts = {}
|
22 |
captcha_modes = {}
|
23 |
|
24 |
+
NOT_ALLOWED_NON_PROGRAMMER = [
|
25 |
+
466019692, # @myexcid,
|
26 |
+
1423479724, # tonic,
|
27 |
+
883761960, # ari
|
28 |
+
6824458358, # None
|
29 |
+
1982318761, # paman
|
30 |
+
5575183435, #suku
|
31 |
+
948247711, # akay
|
32 |
+
]
|
33 |
+
|
34 |
def generate_math_captcha():
|
35 |
operations = ['+', '-', '*']
|
36 |
operation = random.choice(operations)
|
|
|
192 |
|
193 |
@Client.on_message(filters.command("settingmode") & filters.private)
|
194 |
async def setting_mode(client: Client, message: Message):
|
195 |
+
if message.from_user.id in NOT_ALLOWED_NON_PROGRAMMER:
|
196 |
+
return
|
197 |
user_id = message.from_user.id
|
198 |
keyboard = InlineKeyboardMarkup(
|
199 |
[
|
|
|
333 |
reply_markup=create_button_join_group(chat_link)
|
334 |
)
|
335 |
logger.info(f"User {user_id} berhasil memverifikasi CAPTCHA.")
|
336 |
+
if user_id in NOT_ALLOWED_NON_PROGRAMMER:
|
337 |
+
await client.ban_chat_member(chat_id=chat_id, user_id=user_id)
|
338 |
+
return
|
339 |
await client.approve_chat_join_request(
|
340 |
chat_id=chat_id,
|
341 |
user_id=user_id
|