Ver código fonte

Some more webss fixes

TheHamkerCat 5 anos atrás
pai
commit
edea24c796
2 arquivos alterados com 9 adições e 2 exclusões
  1. 5 1
      wbb/modules/webss.py
  2. 4 1
      wbb/utils/inlinefuncs.py

+ 5 - 1
wbb/modules/webss.py

@@ -21,9 +21,13 @@ async def take_ss(_, message):
     screenshot = await fetch(f"https://patheticprogrammers.cf/ss?site={url}")
     await m.edit("**Uploading**")
     end_time = time.time()
-    await app.send_photo(
+    try:
+        await app.send_photo(
             message.chat.id,
             photo=screenshot['url'],
             caption=(f"{url}\n__Took {round(end_time - start_time)} Seconds.__")
             )
+    except TypeError:
+        await m.edit("No Such Website.")
+        return
     await m.delete()

+ 4 - 1
wbb/utils/inlinefuncs.py

@@ -243,7 +243,10 @@ async def webss(url):
         return
     screenshot = await fetch(f"https://patheticprogrammers.cf/ss?site={url}")
     end_time = time()
-    m = await app.send_photo(LOG_GROUP_ID, photo=screenshot['url'])
+    try:
+        m = await app.send_photo(LOG_GROUP_ID, photo=screenshot['url'])
+    except TypeError:
+        return
     await m.delete()
     a = []
     pic = InlineQueryResultPhoto(