import time
import random
import logging
from .. import loader, utils
from random import randint, choice
from asyncio import sleep
from telethon.tl.functions.channels import JoinChannelRequest
logger = logging.getLogger(__name__)
def register(cb):
cb(Premiumfake_ping())
class Premiumfake_ping(loader.Module):
"""Фейк пинг с премиум эмодзи"""
strings = {'name': 'Premium fake ping'}
async def pinjcmd(self, message):
"""Используй .pinj <цифры>."""
text = utils.get_args_raw(message)
if not text:
for pinj in ["🐻 Nofin..."]:
await message.edit(pinj)
await sleep(0.3)
named_tuple = time.localtime()
time_string = time.strftime("%H:%M:%S", named_tuple)
await message.edit(f"⏱ Скорость отклика Telegram: {random.randint(10, 1999)}.{random.randint(10, 99)} ms\n😎 Прошло с последней перезагрузки: {time_string}")
return
else:
for pinj in ["🐻 Nofin..."]:
await message.edit(pinj)
await sleep(0.3)
named_tuple = time.localtime()
time_string = time.strftime("%H:%M:%S", named_tuple)
pinj = (f"⏱ Скорость отклика Telegram: {text} ms\n😎 Прошло с последней перезагрузки: {time_string}")
await message.edit(pinj)