stats.py 535 B

1234567891011121314151617
  1. from wbb import app
  2. from pyrogram import filters
  3. import psutil
  4. from wbb.utils import cust_filter
  5. __MODULE__ = "Stats"
  6. __HELP__ = "For Bot Owner to Check system Status"
  7. @app.on_message(cust_filter.command(commands=(["stats"])))
  8. async def stats(client, message):
  9. cpu = psutil.cpu_percent(interval=0.5)
  10. mem = psutil.virtual_memory().percent
  11. disk = psutil.disk_usage('/').percent
  12. stats = f'<b>CPU:</b> {cpu}% ' \
  13. f'<b>RAM:</b> {mem}% ' \
  14. f'<b>Disk:</b> {disk}%'
  15. await message.reply_text(stats)