refactor: streamline captcha and thread access
Build and Push (dev) / build (push) Successful in 1m29s
Build and Push (dev) / build (push) Successful in 1m29s
This commit is contained in:
@@ -51,14 +51,14 @@ class Config:
|
||||
default_captcha = (
|
||||
f"[CENTER][B]Напишите ответ:[/B]\n"
|
||||
f"сколько будет 20 + 20? [I][COLOR=rgb(80, 80, 78)](Капча меняется раз в месяц)[/COLOR][/I][/CENTER]"
|
||||
)
|
||||
).strip()
|
||||
|
||||
try:
|
||||
captcha = ""
|
||||
with open(file_path, "r", encoding="utf-8") as replies:
|
||||
captcha = replies.read()
|
||||
|
||||
return captcha if captcha else default_captcha
|
||||
return captcha.strip() if captcha else default_captcha
|
||||
|
||||
except FileNotFoundError:
|
||||
return default_captcha
|
||||
@@ -133,7 +133,9 @@ class Config:
|
||||
|
||||
# Validate captcha configuration
|
||||
if enable_captcha and not captcha_answer:
|
||||
raise ConfigError("ENABLE_CAPTCHA установлен, но CAPTCHA_ANSWER не задан")
|
||||
raise ConfigError(
|
||||
"ENABLE_CAPTCHA установлен, но CAPTCHA_ANSWER не задан"
|
||||
)
|
||||
|
||||
return {
|
||||
# Pyrogram
|
||||
|
||||
Reference in New Issue
Block a user