|
@@ -1,14 +1,23 @@
|
|
|
from wbb import app
|
|
from wbb import app
|
|
|
import time
|
|
import time
|
|
|
from wbb.utils import cust_filter
|
|
from wbb.utils import cust_filter
|
|
|
-
|
|
|
|
|
|
|
+import requests
|
|
|
__MODULE__ = "Ping"
|
|
__MODULE__ = "Ping"
|
|
|
__HELP__ = " - /ping - to check if I am Alive or Not"
|
|
__HELP__ = " - /ping - to check if I am Alive or Not"
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.on_message(cust_filter.command(commands=(["ping"])))
|
|
@app.on_message(cust_filter.command(commands=(["ping"])))
|
|
|
async def ping(client, message):
|
|
async def ping(client, message):
|
|
|
- start_time = int(round(time.time() * 1000))
|
|
|
|
|
- m = await message.reply_text("Starting Ping")
|
|
|
|
|
- end_time = int(round(time.time() * 1000))
|
|
|
|
|
- await m.edit(f"{end_time - start_time} ms")
|
|
|
|
|
|
|
+ app.set_parse_mode("markdown")
|
|
|
|
|
+ ping1 = round(requests.head("https://cdn1.telesco.pe/").elapsed.total_seconds() * 1000)
|
|
|
|
|
+ ping2 = round(requests.head("https://cdn2.telesco.pe/").elapsed.total_seconds() * 1000)
|
|
|
|
|
+ ping3 = round(requests.head("https://cdn3.telesco.pe/").elapsed.total_seconds() * 1000)
|
|
|
|
|
+ ping4 = round(requests.head("https://cdn4.telesco.pe/").elapsed.total_seconds() * 1000)
|
|
|
|
|
+ ping5 = round(requests.head("https://cdn5.telesco.pe/").elapsed.total_seconds() * 1000)
|
|
|
|
|
+ await message.reply_text(f'''
|
|
|
|
|
+```DC1 - {ping1}ms
|
|
|
|
|
+DC2 - {ping2}ms
|
|
|
|
|
+DC3 - {ping3}ms
|
|
|
|
|
+DC4 - {ping4}ms
|
|
|
|
|
+DC5 - {ping5}ms```
|
|
|
|
|
+''')
|