1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-19 23:56:16 +00:00

Chinese language support (suddenly!)

This commit is contained in:
mihalin
2022-03-22 05:43:10 +03:00
parent db54473e0f
commit 1a9646d607
18 changed files with 740 additions and 126 deletions

View File

@@ -8,6 +8,7 @@ from olgram.models import models
from olgram.router import dp
from olgram.settings import OlgramSettings
from locales.locale import _
@dp.message_handler(commands=["info"], state="*")
@@ -17,7 +18,7 @@ async def info(message: types.Message, state: FSMContext):
"""
if message.chat.id != OlgramSettings.supervisor_id():
await message.answer("Недостаточно прав")
await message.answer(_("Недостаточно прав"))
return
bots = await models.Bot.all()
@@ -28,8 +29,8 @@ async def info(message: types.Message, state: FSMContext):
income_messages = sum([bot.incoming_messages_count for bot in bots])
outgoing_messages = sum([bot.outgoing_messages_count for bot in bots])
await message.answer(f"Количество ботов: {bots_count}\n"
f"Количество пользователей (у конструктора): {user_count}\n"
f"Шаблонов ответов: {templates_count}\n"
f"Входящих сообщений у всех ботов: {income_messages}\n"
f"Исходящих сообщений у всех ботов: {outgoing_messages}\n")
await message.answer(_("Количество ботов: {0}\n").format(bots_count) +
_("Количество пользователей (у конструктора): {0}\n").format(user_count) +
_("Шаблонов ответов: {0}\n").format(templates_count) +
_("Входящих сообщений у всех ботов: {0}\n").format(income_messages) +
_("Исходящих сообщений у всех ботов: {0}\n").format(outgoing_messages))