ᴀᴛʟᴇᴀsᴛ ɢɪᴠᴇ ᴀ sᴛᴀʀ ᴀɴᴅ ғᴏʀᴋ ᴛʜᴇ ʀᴇᴘᴏ
API_ID
: Telegram API_ID, get it from my.telegram.org/appsAPI_HASH
: Telegram API_ID, get it from my.telegram.org/appsSTRING_SESSION
: A valid Pyrogram session string, get it from @StringGenratorbotBOT_LIST
: Your bot username list without '@' (Example: Atiya_Robot PyroHackRobot)CHANNEL_ID
: Your channel's Telegram id (Example: -1001887171460)MESSAGE_ID
: Telegram id of message from your channel or group (Example: 45)LOG_ID
: Log id (Example: -1001565615923)TIME_ZONE
: Your time zone (Example: Asia/Kolkata)
ɴᴏᴡ ᴄᴏᴘʏ ᴛʜᴇ ғᴏʟʟᴏᴡɪɴɢ ᴄᴏᴅᴇ ᴀɴᴅ ᴀᴅᴅ ɪɴᴛᴏ ʏᴏᴜʀ ʀᴇᴘᴏsɪᴛᴏʀʏ ɪɴ ᴘʟᴜɢɪɴs ᴅɪʀᴇᴄᴛᴏʀʏ :
import psutil
import time
from pyrogram import Client
from pyrogram import 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("RocksStatusBot"))
async def activevc(_, message: Message):
uptime = time_formatter((time.time() - start_time) * 1000)
cpu = psutil.cpu_percent()
TEXT = f"**ᴜᴘᴛɪᴍᴇ** : {uptime} | **ᴄᴘᴜ** : {cpu}%"
await message.reply(TEXT)
━━━━━━━━━━━━━━━━━━━━
- Update and upgrade by :
sudo apt-get update && sudo apt-get upgrade -y
- Clone the repository by :
git clone https://github.com/ItzRocksKrishna/StatusChecker && cd StatusChecker
- Install requirements by :
pip3 install -U -r requirements.txt
- Create .env using sample.env by
cp sample.env .env
- Now open the .env file using
vi .env
- Edit the vars, by pressing
I
on the keyboard - After editing save the file using
ctrl + c
then:wq
- Finally run the script using python3 :
python3 main.py
━━━━━━━━━━━━━━━━━━━━