diff --git a/src/join_captcha_bot.py b/src/join_captcha_bot.py index 3f2ca07..60b644c 100644 --- a/src/join_captcha_bot.py +++ b/src/join_captcha_bot.py @@ -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" diff --git a/src/language/ar.json b/src/language/ar.json index cb3f4b5..744e2bd 100644 --- a/src/language/ar.json +++ b/src/language/ar.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/be.json b/src/language/be.json index e58abf9..94e8dc0 100644 --- a/src/language/be.json +++ b/src/language/be.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/ca.json b/src/language/ca.json index 2baa901..3c790db 100644 --- a/src/language/ca.json +++ b/src/language/ca.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/de.json b/src/language/de.json index 36467a2..502de81 100644 --- a/src/language/de.json +++ b/src/language/de.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/el.json b/src/language/el.json index d92cd83..a379994 100644 --- a/src/language/el.json +++ b/src/language/el.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/en.json b/src/language/en.json index dcc90fc..e5691fd 100644 --- a/src/language/en.json +++ b/src/language/en.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/eo.json b/src/language/eo.json index b7e818a..cbb25ef 100644 --- a/src/language/eo.json +++ b/src/language/eo.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/es.json b/src/language/es.json index 77ac1fc..393d5ee 100644 --- a/src/language/es.json +++ b/src/language/es.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/eu.json b/src/language/eu.json index 427bd29..631372d 100644 --- a/src/language/eu.json +++ b/src/language/eu.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/fa.json b/src/language/fa.json index 323dd23..8e7fe7f 100644 --- a/src/language/fa.json +++ b/src/language/fa.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/fi.json b/src/language/fi.json index d3260d6..fc15ed5 100644 --- a/src/language/fi.json +++ b/src/language/fi.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/fr.json b/src/language/fr.json index 4e1b098..de04a02 100644 --- a/src/language/fr.json +++ b/src/language/fr.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/gl.json b/src/language/gl.json index 51c8f1a..4901fbc 100644 --- a/src/language/gl.json +++ b/src/language/gl.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/he.json b/src/language/he.json index 4e5b2bc..4ea0f4a 100644 --- a/src/language/he.json +++ b/src/language/he.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/id.json b/src/language/id.json index 848894d..4c6025a 100644 --- a/src/language/id.json +++ b/src/language/id.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/it.json b/src/language/it.json index 0f48f3a..76e4b8d 100644 --- a/src/language/it.json +++ b/src/language/it.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/kn.json b/src/language/kn.json index a939acd..716addd 100644 --- a/src/language/kn.json +++ b/src/language/kn.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/ko.json b/src/language/ko.json index 50c3059..3b48d63 100644 --- a/src/language/ko.json +++ b/src/language/ko.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/nl.json b/src/language/nl.json index 2703c88..1952fd2 100644 --- a/src/language/nl.json +++ b/src/language/nl.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/pl.json b/src/language/pl.json index 9802d4c..9a66979 100644 --- a/src/language/pl.json +++ b/src/language/pl.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/pt_br.json b/src/language/pt_br.json index fc1a98a..0a1f8d4 100644 --- a/src/language/pt_br.json +++ b/src/language/pt_br.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/ru.json b/src/language/ru.json index 8af0ec2..80d5122 100644 --- a/src/language/ru.json +++ b/src/language/ru.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/sk.json b/src/language/sk.json index 5c27426..e1e9c1d 100644 --- a/src/language/sk.json +++ b/src/language/sk.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/sr.json b/src/language/sr.json index d5a5a1c..446a905 100644 --- a/src/language/sr.json +++ b/src/language/sr.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } \ No newline at end of file diff --git a/src/language/tr.json b/src/language/tr.json index 359cd34..f7baa7c 100644 --- a/src/language/tr.json +++ b/src/language/tr.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/uk.json b/src/language/uk.json index e1c3073..fa5376c 100644 --- a/src/language/uk.json +++ b/src/language/uk.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/uz.json b/src/language/uz.json index 80eac8b..97ab731 100644 --- a/src/language/uz.json +++ b/src/language/uz.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" } diff --git a/src/language/zh_cn.json b/src/language/zh_cn.json index 8abb2be..3c383f5 100644 --- a/src/language/zh_cn.json +++ b/src/language/zh_cn.json @@ -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 sec\nor /time secs\nor /time seconds\nor /time s\nMinutes:\n/time min\nor /time mins\nor /time minutes\nor /time m" }