Skip to content

Repository files navigation

sᴛᴀᴛᴜs ᴄʜᴇᴄᴋᴇʀ

At least give a Star and Fork the repo

📜 Plugin Code

Copy the following code and add it into your plugins directory:

import psutil
import time
from pyrogram import Client, filters
from pyrogram.types import Message

start_time = time.time()

def time_formatter(milliseconds):
    minutes, seconds = divmod(int(milliseconds / 1000), 60)
    hours, minutes = divmod(minutes, 60)
    days, hours = divmod(hours, 24)
    weeks, days = divmod(days, 7)
    tmp = (((str(weeks) + "ᴡ:") if weeks else "") +
           ((str(days) + "ᴅ:") if days else "") +
           ((str(hours) + "ʜ:") if hours else "") +
           ((str(minutes) + "ᴍ:") if minutes else "") +
           ((str(seconds) + "s") if seconds else ""))
    if not tmp:
        return "0s"
    if tmp.endswith(":"):
        return tmp[:-1]
    return tmp


@Client.on_message(filters.command("statuscheck"))
async def status(_, message: Message):
    uptime = time_formatter((time.time() - start_time) * 1000)
    cpu = psutil.cpu_percent()
    TEXT = f"ᴜᴘᴛɪᴍᴇ : {uptime} | ᴄᴘᴜ : {cpu}%"
    await message.reply(TEXT)

🚀 Deploy on Heroku


⚡ Deploy on VPS

  1. Get your Necessary Variables
  2. Update and upgrade:
    sudo apt-get update && sudo apt-get upgrade -y
  3. Install required packages:
    sudo apt-get install python3-pip
  4. Upgrade pip:
    pip3 install -U pip
  5. Clone the repository:
    git clone https://github.com/Kanha-XD/StatusChecker && cd StatusChecker
  6. Install requirements:
    pip3 install -U -r requirements.txt
  7. Fill in environment variables:
    vi sample.env
    Press I to edit, Ctrl+C when done, then type :wq to save.
  8. Rename the env file:
    mv sample.env .env
  9. Install tmux and start session:
    sudo apt install tmux && tmux
  10. Run the bot:
    bash start

📦 Requirements


💬 Support

About

Easy and powerful bot to check if all your Telegram bots are working or not.

Resources

Stars

Watchers

Forks

Contributors

Languages