Initial commit

This commit is contained in:
Xtao_dada 2022-02-03 00:15:49 +08:00 committed by GitHub
parent 8ee30d394c
commit db3b102773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ from platform import uname, python_version
from sys import platform from sys import platform
from pyrogram import Client, __version__ from pyrogram import Client, __version__
from pyrogram.raw.functions import Ping
from getpass import getuser from getpass import getuser
from socket import gethostname from socket import gethostname
@ -72,10 +73,14 @@ async def status(client: Client, message: Message):
async def ping(client: Client, message: Message): async def ping(client: Client, message: Message):
""" Calculates latency between PagerMaid and Telegram. """ """ Calculates latency between PagerMaid and Telegram. """
start = datetime.now() start = datetime.now()
await client.send(Ping(ping_id=0))
end = datetime.now()
ping_duration = (end - start).microseconds / 1000
start = datetime.now()
await message.edit("Pong!") await message.edit("Pong!")
end = datetime.now() end = datetime.now()
duration = (end - start).microseconds / 1000 msg_duration = (end - start).microseconds / 1000
await message.edit(f"Pong!|{duration}") await message.edit(f"Pong!| PING: {ping_duration} | MSG: {msg_duration}")
def wmic(command: str): def wmic(command: str):