version-0.2.0

This commit is contained in:
2024-01-06 14:25:35 +03:00
parent bc05b93c47
commit 908529b5bb
26 changed files with 185 additions and 153 deletions

15
handlers/command_graph.py Normal file
View File

@@ -0,0 +1,15 @@
from utils.graph import generate_chart
from bot.api import send_document
from storage import storage, scan
import json
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
async def handle_command_graph(msg):
_usr_ids, members = scan(match="usr-*", count=100)
data = generate_chart(members)
if data:
r = await send_document(msg["chat"]["id"], data, "chart.svg")
logger.debug(r)