Files
welcomecenterbot/tgbot/handlers/command_graph.py

13 lines
361 B
Python
Raw Normal View History

2023-04-23 19:54:58 +03:00
from tgbot.utils.graph import generate_chart
from tgbot.api import send_document
2023-04-28 15:24:14 +03:00
from tgbot.storage import storage, scan
2023-04-23 19:54:58 +03:00
import json
async def handle_command_graph(msg):
2023-04-28 15:24:14 +03:00
usr_ids, members = scan(match='usr-*', count=100)
2023-04-23 19:54:58 +03:00
data = generate_chart(members)
2023-04-24 09:14:35 +03:00
if data:
r = await send_document(msg['chat']['id'], data, 'chart.svg')
print(r)