Просмотр исходного кода

Merge pull request #5 from thehamkercat/pnut-dev

Pnut dev
Akshay Rajput 5 лет назад
Родитель
Сommit
ce349e535a
5 измененных файлов с 15 добавлено и 9 удалено
  1. 1 1
      sample_config.ini
  2. 1 1
      wbb/commit.txt
  3. 11 5
      wbb/modules/ping.py
  4. 1 1
      wbb/modules/repo.py
  5. 1 1
      wbb/start.txt

+ 1 - 1
sample_config.ini

@@ -11,4 +11,4 @@ prefixes = /
 
 
 [mods]
 [mods]
 load_modules =
 load_modules =
-noload_modules =
+noload_modules =

+ 1 - 1
wbb/commit.txt

@@ -602,4 +602,4 @@ refuckulated the carbonator
 starting the service is always better
 starting the service is always better
 Fix all errors, all errors on the WORLD!!!!
 Fix all errors, all errors on the WORLD!!!!
 god help us all
 god help us all
-lets drink beer
+lets drink beer

+ 11 - 5
wbb/modules/ping.py

@@ -1,14 +1,20 @@
 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
+import inspect
 __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")
+    m = await message.reply_text("```Wait, Pinging all Datacenters```")
+    result = ""
+    for i in range(1, 6):
+        dc = (f"https://cdn{i}.telesco.pe")
+        ping1 = round(requests.head(dc).elapsed.total_seconds() * 1000)   
+        result += f'```DC{i} - {ping1}ms```'
+    await m.edit(result)

+ 1 - 1
wbb/modules/repo.py

@@ -13,4 +13,4 @@ async def commit(client, message):
 
 
 🔗 Repo - github.com/thehamkercat/WilliamButcherBot
 🔗 Repo - github.com/thehamkercat/WilliamButcherBot
 
 
-❤️ PRs Are Always Welcomed''', disable_web_page_preview=True)
+❤️ PRs Are Always Welcomed''', disable_web_page_preview=True)

+ 1 - 1
wbb/start.txt

@@ -9,4 +9,4 @@ Well Well Well if it ain't the invisible cunt.
 Why i'm dying to live if i'm living to die?
 Why i'm dying to live if i'm living to die?
 Mama ain't raised no bitch, ima speak up when i need to.
 Mama ain't raised no bitch, ima speak up when i need to.
 Not to brag but i don't even need errors to make bad decisions.
 Not to brag but i don't even need errors to make bad decisions.
-What Am I? Friend or Foe? Bot or Hoe?, No one knows!
+What Am I? Friend or Foe? Bot or Hoe?, No one knows!