welcomecenterbot/bot/handlers/command_graph.py
2023-09-11 23:21:55 +03:00

13 lines
344 B
Python

from utils.graph import generate_chart
from api import send_document
from storage import storage, scan
import json
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")
print(r)