Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/join_captcha_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,13 +2370,17 @@ async def cmd_time(update: Update, context: ContextTypes.DEFAULT_TYPE):
bot, chat_type, chat_id, TEXT[lang]["TIME_NOT_NUM"],
topic_id=tlg_get_msg_topic(update_msg))
return
# Get time arguments
# Require user to provide unit
if len(args) < 2:
await tlg_send_msg_type_chat(
bot, chat_type, chat_id,
TEXT[lang]["TIME_UNIT_REQUIRED"],
topic_id=tlg_get_msg_topic(update_msg))
return
# Get time value and unit
new_time = int(args[0])
min_sec = "min"
if len(args) > 1:
min_sec = args[1].lower()
# Check if time format is not minutes or seconds
# Convert time value to seconds if min format
min_sec = args[1].lower()
# Validate and convert
if min_sec in ["m", "min", "mins", "minutes"]:
min_sec = "min"
new_time_str = f"{new_time} min"
Expand Down
4 changes: 3 additions & 1 deletion src/language/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuración cambiada. Los Mensajes de Captcha se enviarán en un solo idioma.",

"BILANG_MSG_YES":
"Configuración cambiada. Los Mensajes de Captcha se enviarán en dos idiomas."
"Configuración cambiada. Los Mensajes de Captcha se enviarán en dos idiomas.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/sr.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Konfiguracija je promenjena. Tekst Captcha poruka će biti prikazan na jednom jeziku.",

"BILANG_MSG_YES":
"Konfiguracija je promenjena. Tekst Captcha poruka će biti prikazan na dva jezika."
"Konfiguracija je promenjena. Tekst Captcha poruka će biti prikazan na dva jezika.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/uz.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Sozlama o‘zgartirildi. CAPTCHA xabar matnlari faqat bitta tilda ko‘rsatiladi.",

"BILANG_MSG_YES":
"Sozlama o‘zgartirildi. CAPTCHA xabar matnlari ikkita til (inglizcha va tanlangan til) ko‘rsatiladi."
"Sozlama o‘zgartirildi. CAPTCHA xabar matnlari ikkita til (inglizcha va tanlangan til) ko‘rsatiladi.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}
4 changes: 3 additions & 1 deletion src/language/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,7 @@
"Configuration changed. Captcha messages text will be shown in a single language.",

"BILANG_MSG_YES":
"Configuration changed. Captcha messages text will be shown in two languages."
"Configuration changed. Captcha messages text will be shown in two languages.",
"TIME_UNIT_REQUIRED":
"⚠️ Please specify unit.\nUsage:\nSeconds:\n/time <value> sec\nor /time <value> secs\nor /time <value> seconds\nor /time <value> s\nMinutes:\n/time <value> min\nor /time <value> mins\nor /time <value> minutes\nor /time <value> m"
}