olgram/olgram/commands/info.py

28 lines
759 B
Python
Raw Normal View History

2021-12-24 19:20:53 +03:00
"""
Здесь метрики
"""
from aiogram import types
from aiogram.dispatcher import FSMContext
from olgram.models import models
from olgram.router import dp
from olgram.settings import OlgramSettings
@dp.message_handler(commands=["info"], state="*")
async def info(message: types.Message, state: FSMContext):
"""
Команда /info
"""
2021-12-24 19:46:46 +03:00
if message.chat.id != OlgramSettings.supervisor_id():
await message.answer("Недостаточно прав")
2021-12-24 19:20:53 +03:00
return
bots_count = len(await models.Bot.all())
user_count = len(await models.User.all())
await message.answer(f"Количество ботов: {bots_count}"
f"Количество пользователей: {user_count}")