welcomecenterbot/bot/handlers/command_graph.py

13 lines
344 B
Python
Raw Normal View History

2023-09-11 20:21:55 +00:00
from utils.graph import generate_chart
from api import send_document
from storage import storage, scan
2023-04-23 16:54:58 +00:00
import json
async def handle_command_graph(msg):
2023-09-11 20:04:53 +00:00
_usr_ids, members = scan(match="usr-*", count=100)
2023-04-23 16:54:58 +00:00
data = generate_chart(members)
2023-04-24 06:14:35 +00:00
if data:
2023-09-11 20:04:53 +00:00
r = await send_document(msg["chat"]["id"], data, "chart.svg")
2023-04-24 06:14:35 +00:00
print(r)