Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
*.mo

.env
.venv/
2 changes: 2 additions & 0 deletions aiogram_bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@

SUPERUSER_STARTUP_NOTIFIER = env.bool("SUPERUSER_STARTUP_NOTIFIER", default=False)
HASTEBIN_URL = env.str("HASTEBIN_URL", default="https://paste.aiogram.dev")

AIOGRAM_JAIL_LINK = "https://t.me/aiogram_jail"
4 changes: 2 additions & 2 deletions aiogram_bot/handlers/new_chat_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async def new_chat_member(message: types.Message, chat: Chat):
"{users}, Welcome to the chat. \n"
"Please confirm that you are a human. "
"User filter is enabled in this chat, so if you don't answer my question, "
"I will be forced to remove you from this chat."
).format(users=", ".join(users.values())),
"I will be forced to remove you from this chat and you will be <a href='{jail_link}'>imprisoned</a>."
).format(users=", ".join(users.values()), jail_link=config.AIOGRAM_JAIL_LINK),
reply_markup=types.InlineKeyboardMarkup(row_width=3).add(*buttons),
)
await join_list.create_list(
Expand Down
17 changes: 15 additions & 2 deletions aiogram_bot/handlers/simple_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from aiogram.utils.markdown import hlink, quote_html
from babel.dates import format_timedelta
from loguru import logger
from aiogram_bot import config

from aiogram_bot.misc import bot, dp, i18n
from aiogram_bot.models.chat import Chat
Expand Down Expand Up @@ -44,8 +45,14 @@ async def cmd_ro(message: types.Message, chat: Chat):
return False

await message.reply_to_message.answer(
_("<b>Read-only</b> activated for user {user}. Duration: {duration}").format(
_(
"<b>Read-only</b> activated for user {user}. Duration: {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat where you can "
"tell your opinion about the work of the administrators and it "
"will definitely be heard!"
).format(
user=message.reply_to_message.from_user.get_mention(),
jail_link=config.AIOGRAM_JAIL_LINK,
duration=format_timedelta(
duration, locale=chat.language, granularity="seconds", format="short"
),
Expand Down Expand Up @@ -79,8 +86,14 @@ async def cmd_ban(message: types.Message, chat: Chat):
return False

await message.reply_to_message.answer(
_("User {user} <b>banned</b> for {duration}").format(
_(
"User {user} <b>banned</b> for {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat where you can "
"tell your opinion about the work of the administrators and it "
"will definitely be heard!"
).format(
user=message.reply_to_message.from_user.get_mention(),
jail_link=config.AIOGRAM_JAIL_LINK,
duration=format_timedelta(
duration, locale=chat.language, granularity="seconds", format="short"
),
Expand Down
45 changes: 28 additions & 17 deletions locales/bot.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aiogram_bot 0.1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-08-22 18:46+0300\n"
"POT-Creation-Date: 2021-11-24 10:40+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -20,8 +20,8 @@ msgstr ""
#: aiogram_bot/handlers/base.py:17
msgid ""
"Hello, {user}.\n"
"Send /help if you want to read my commands list and also you can change language by sending "
"/settings command.\n"
"Send /help if you want to read my commands list and also you can change "
"language by sending /settings command.\n"
"My source code: {source_url}"
msgstr ""

Expand Down Expand Up @@ -79,7 +79,8 @@ msgid ""
"{aiogram}"
msgstr ""

#: aiogram_bot/handlers/chat_settings.py:53 aiogram_bot/handlers/chat_settings.py:95
#: aiogram_bot/handlers/chat_settings.py:53
#: aiogram_bot/handlers/chat_settings.py:95
#: aiogram_bot/handlers/chat_settings.py:133
msgid "Invalid chat"
msgstr ""
Expand All @@ -88,7 +89,8 @@ msgstr ""
msgid "Choose chat language"
msgstr ""

#: aiogram_bot/handlers/chat_settings.py:99 aiogram_bot/handlers/chat_settings.py:137
#: aiogram_bot/handlers/chat_settings.py:99
#: aiogram_bot/handlers/chat_settings.py:137
msgid "You cannot change settings of this chat!"
msgstr ""

Expand Down Expand Up @@ -141,8 +143,9 @@ msgstr ""
#: aiogram_bot/handlers/new_chat_members.py:87
msgid ""
"{users}, Welcome to the chat. \n"
"Please confirm that you are a human. User filter is enabled in this chat, so if you don't answer"
" my question, I will be forced to remove you from this chat."
"Please confirm that you are a human. User filter is enabled in this chat,"
" so if you don't answer my question, I will be forced to remove you from "
"this chat and you will be <a href='{jail_link}'>imprisoned</a>."
msgstr ""

#: aiogram_bot/handlers/new_chat_members.py:123
Expand All @@ -157,29 +160,37 @@ msgstr ""
msgid "Bad answer."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:47
msgid "<b>Read-only</b> activated for user {user}. Duration: {duration}"
#: aiogram_bot/handlers/simple_admin.py:48
msgid ""
"<b>Read-only</b> activated for user {user}. Duration: {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:82
msgid "User {user} <b>banned</b> for {duration}"
#: aiogram_bot/handlers/simple_admin.py:89
msgid ""
"User {user} <b>banned</b> for {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:111
#: aiogram_bot/handlers/simple_admin.py:124
msgid ""
"Please use this command is only in reply to message what do you want to report and this message "
"will be reported to chat administrators."
"Please use this command is only in reply to message what do you want to "
"report and this message will be reported to chat administrators."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:118
#: aiogram_bot/handlers/simple_admin.py:131
msgid "[ALERT] User {user} is reported message in chat {chat}."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:140
#: aiogram_bot/handlers/simple_admin.py:153
msgid "This message is reported to chat administrators."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:152
#: aiogram_bot/handlers/simple_admin.py:165
msgid "User {user} leave this chat..."
msgstr ""

Expand Down
43 changes: 33 additions & 10 deletions locales/en/LC_MESSAGES/bot.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aiogram_bot 0.1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-08-22 18:46+0300\n"
"POT-Creation-Date: 2021-11-24 10:40+0000\n"
"PO-Revision-Date: 2019-10-22 00:12+0300\n"
"Last-Translator: \n"
"Language: en\n"
Expand Down Expand Up @@ -147,7 +147,7 @@ msgid ""
"{users}, Welcome to the chat. \n"
"Please confirm that you are a human. User filter is enabled in this chat,"
" so if you don't answer my question, I will be forced to remove you from "
"this chat."
"this chat and you will be <a href='{jail_link}'>imprisoned</a>."
msgstr ""

#: aiogram_bot/handlers/new_chat_members.py:123
Expand All @@ -162,29 +162,37 @@ msgstr ""
msgid "Bad answer."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:47
msgid "<b>Read-only</b> activated for user {user}. Duration: {duration}"
#: aiogram_bot/handlers/simple_admin.py:48
msgid ""
"<b>Read-only</b> activated for user {user}. Duration: {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:82
msgid "User {user} <b>banned</b> for {duration}"
#: aiogram_bot/handlers/simple_admin.py:89
msgid ""
"User {user} <b>banned</b> for {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:111
#: aiogram_bot/handlers/simple_admin.py:124
msgid ""
"Please use this command is only in reply to message what do you want to "
"report and this message will be reported to chat administrators."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:118
#: aiogram_bot/handlers/simple_admin.py:131
msgid "[ALERT] User {user} is reported message in chat {chat}."
msgstr "🔥🔥🔥 User {user} is reported message in chat {chat}."

#: aiogram_bot/handlers/simple_admin.py:140
#: aiogram_bot/handlers/simple_admin.py:153
msgid "This message is reported to chat administrators."
msgstr ""

#: aiogram_bot/handlers/simple_admin.py:152
#: aiogram_bot/handlers/simple_admin.py:165
msgid "User {user} leave this chat..."
msgstr ""

Expand Down Expand Up @@ -220,3 +228,18 @@ msgstr ""
msgid "{status} Do not disturb"
msgstr ""

#~ msgid ""
#~ "{users}, Welcome to the chat. \n"
#~ "Please confirm that you are a "
#~ "human. User filter is enabled in "
#~ "this chat, so if you don't answer"
#~ " my question, I will be forced "
#~ "to remove you from this chat."
#~ msgstr ""

#~ msgid "<b>Read-only</b> activated for user {user}. Duration: {duration}"
#~ msgstr ""

#~ msgid "User {user} <b>banned</b> for {duration}"
#~ msgstr ""

47 changes: 34 additions & 13 deletions locales/ru/LC_MESSAGES/bot.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: aiogram_bot 0.1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-08-22 18:46+0300\n"
"POT-Creation-Date: 2021-11-24 10:40+0000\n"
"PO-Revision-Date: 2019-11-06 11:40+0200\n"
"Last-Translator: \n"
"Language: ru\n"
Expand Down Expand Up @@ -153,16 +153,17 @@ msgid "I'm human"
msgstr "Я человек"

#: aiogram_bot/handlers/new_chat_members.py:87
#, fuzzy
msgid ""
"{users}, Welcome to the chat. \n"
"Please confirm that you are a human. User filter is enabled in this chat,"
" so if you don't answer my question, I will be forced to remove you from "
"this chat."
"this chat and you will be <a href='{jail_link}'>imprisoned</a>."
msgstr ""
"Привет, {users}!\n"
"Пожалуйста подтверди, что ты человек. В этом чате включен фильтр новых "
"пользователей, поэтому, если ты не ответишь на мой вопрос, я буду "
"вынужден прогнать тебя из чата."
"вынужден прогнать тебя из чата и отправить в <a href='{jail_link}'>тюрьму</a>."

#: aiogram_bot/handlers/new_chat_members.py:123
msgid "This message is not for you!"
Expand All @@ -176,31 +177,45 @@ msgstr "Хороший ответ!"
msgid "Bad answer."
msgstr "Плохой ответ."

#: aiogram_bot/handlers/simple_admin.py:47
msgid "<b>Read-only</b> activated for user {user}. Duration: {duration}"
msgstr "Пользователь {user} помещен в <b>RO</b> на {duration}"
#: aiogram_bot/handlers/simple_admin.py:48
msgid ""
"<b>Read-only</b> activated for user {user}. Duration: {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""
"Пользователь {user} помещен в <b>RO</b> на {duration}\n"
"Теперь вам открыт доступ к <a href='{jail_link}'>Aiogram Jail</a>, чат где вы можете "
"высказать своё мнение о работе администраторов и оно будет обязательно услышано!"

#: aiogram_bot/handlers/simple_admin.py:82
msgid "User {user} <b>banned</b> for {duration}"
msgstr "Пользователь {user} <b>забанен</b> на {duration}"
#: aiogram_bot/handlers/simple_admin.py:89
msgid ""
"User {user} <b>banned</b> for {duration}\n"
"Now you have access to <a href='{jail_link}'>Aiogram Jail</a>, a chat "
"where you can tell your opinion about the work of the administrators and "
"it will definitely be heard!"
msgstr ""
"Пользователь {user} <b>забанен</b> на {duration}\n"
"Теперь вам открыт доступ к <a href='{jail_link}'>Aiogram Jail</a>, чат где вы можете "
"высказать своё мнение о работе администраторов и оно будет обязательно услышано!"

#: aiogram_bot/handlers/simple_admin.py:111
#: aiogram_bot/handlers/simple_admin.py:124
msgid ""
"Please use this command is only in reply to message what do you want to "
"report and this message will be reported to chat administrators."
msgstr ""
"Пожалуйста, используй эту команду только в ответ на другое сообщение и я "
"сообщу про него администрации чата."

#: aiogram_bot/handlers/simple_admin.py:118
#: aiogram_bot/handlers/simple_admin.py:131
msgid "[ALERT] User {user} is reported message in chat {chat}."
msgstr "🔥 Пользователь {user} сообщает про сообщение в чате {chat}."

#: aiogram_bot/handlers/simple_admin.py:140
#: aiogram_bot/handlers/simple_admin.py:153
msgid "This message is reported to chat administrators."
msgstr "Я сообщил про это сообщение администрации чата."

#: aiogram_bot/handlers/simple_admin.py:152
#: aiogram_bot/handlers/simple_admin.py:165
msgid "User {user} leave this chat..."
msgstr "Пользователь {user} покинул этот чат..."

Expand Down Expand Up @@ -240,3 +255,9 @@ msgstr "Персональные настройки"
msgid "{status} Do not disturb"
msgstr "{status} Не беспокоить"

#~ msgid "<b>Read-only</b> activated for user {user}. Duration: {duration}"
#~ msgstr "Пользователь {user} помещен в <b>RO</b> на {duration}"

#~ msgid "User {user} <b>banned</b> for {duration}"
#~ msgstr "Пользователь {user} <b>забанен</b> на {duration}"

Loading