reduce useless code da.
This commit is contained in:
1 parent
b958bddcfb
commit
bbad4ff2c3
2 files changed
+16
-17
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ def is_blocked(user_id):
|
||||
if time_diff < 3:
|
||||
alo = "🚫 *файл не вошёл.* хватит так быстро слать свои сообщения.\n" \
|
||||
f"подожди {round(3 - time_diff, 3)} секунд, брат😡😡"
|
||||
elif last_command_time[user_id][1] and time_diff < 10:
|
||||
elif last_command_time[user_id][1] and time_diff < 5:
|
||||
alo = "🚫 *файл не вошёл.* я ещё не сгенерировал прошлое сообщение.\n" \
|
||||
f"подожди {round(10 - time_diff, 3)} секунд, чтобы я закрыл глаза " \
|
||||
"на это da."
|
||||
|
||||
@@ -153,6 +153,12 @@ async def guest_middleware(handler, event, data):
|
||||
elif replied and replied.voice:
|
||||
voice = replied.voice
|
||||
|
||||
location = None
|
||||
if message.location:
|
||||
location = message.location
|
||||
elif replied and replied.voice:
|
||||
location = replied.location
|
||||
|
||||
if voice:
|
||||
if voice.duration > 60:
|
||||
da = "не врат не пойдёт такой длинный голосовой сообщение" \
|
||||
@@ -224,20 +230,11 @@ async def guest_middleware(handler, event, data):
|
||||
print(f"{RED} -- {e}{RESET}")
|
||||
return
|
||||
|
||||
if replied and replied.location:
|
||||
loc = replied.location
|
||||
if location:
|
||||
prompt += (
|
||||
f"<ответ на локацию>\n"
|
||||
f"{loc.latitude}, {loc.longitude}\n"
|
||||
f"</ответ на локацию>\n"
|
||||
)
|
||||
|
||||
if message.location:
|
||||
loc = message.location
|
||||
prompt += (
|
||||
f"<локация>\n"
|
||||
f"{loc.latitude}, {loc.longitude}\n"
|
||||
f"</локация>\n"
|
||||
f"<геолокация>\n"
|
||||
f"{location.latitude}, {location.longitude}\n"
|
||||
f"</геолокация>\n"
|
||||
)
|
||||
|
||||
if replied and replied.poll:
|
||||
@@ -376,6 +373,7 @@ async def guest_middleware(handler, event, data):
|
||||
last_command_time[user_id][1] = False
|
||||
last_command_time[user_id][2] = []
|
||||
|
||||
try:
|
||||
if ":" in result and ("poll" in result or "quiz" in result):
|
||||
pw = ["[poll]", "poll", "quiz"]
|
||||
rl = result.split("\n")
|
||||
@@ -442,8 +440,9 @@ async def guest_middleware(handler, event, data):
|
||||
await g_answer(message, "отправил опрос в личку, так как гостевой режим не работает с " \
|
||||
"опросами✅✅"
|
||||
)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(f"{YELLOW} -- poll parsing - {e}{RESET}")
|
||||
else:
|
||||
return
|
||||
|
||||
kwargs = (
|
||||
@@ -491,7 +490,7 @@ async def guest_middleware(handler, event, data):
|
||||
else:
|
||||
await message.reply(**kwargs)
|
||||
except Exception as e:
|
||||
print(f"{RED} -- send guest - {e}{RESET}")
|
||||
print(f"{RED} -- send msg - {e}{RESET}")
|
||||
else:
|
||||
print(f"{YELLOW} -- markdown - {e}{RESET}")
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user