none
This commit is contained in:
parent
6a213c3ae2
commit
4d9c97bdc5
@ -1,5 +1,4 @@
|
||||
# credit to TeamYukki for this speedtest module
|
||||
|
||||
import os
|
||||
import wget
|
||||
import speedtest
|
||||
@ -14,20 +13,21 @@ from pyrogram.types import Message
|
||||
|
||||
|
||||
@Client.on_message(command(["speedtest", f"speedtest@{bname}"]) & ~filters.edited)
|
||||
async def statsguwid(_, message: Message):
|
||||
m = await message.reply_text("Running server speedtest.")
|
||||
@sudo_users_only
|
||||
async def run_speedtest(_, message: Message):
|
||||
m = await message.reply_text("Running server speedtest -->")
|
||||
try:
|
||||
test = speedtest.Speedtest()
|
||||
test.get_best_server()
|
||||
m = await m.edit("Running download speedtest..")
|
||||
m = await m.edit("Running download speedtest --->")
|
||||
test.download()
|
||||
m = await m.edit("Running upload speedtest...")
|
||||
m = await m.edit("Running upload speedtest ---->")
|
||||
test.upload()
|
||||
test.results.share()
|
||||
result = test.results.dict()
|
||||
except Exception as e:
|
||||
return await m.edit(e)
|
||||
m = await m.edit("Sharing speedtest results....")
|
||||
m = await m.edit("🔄 Sharing speedtest results")
|
||||
path = wget.download(result["share"])
|
||||
|
||||
output = f"""💡 **SpeedTest Results**
|
||||
|
Loading…
Reference in New Issue
Block a user