TheHamkerCat 5 лет назад
Родитель
Сommit
ee4964b8d3
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      wbb/modules/images.py

+ 3 - 2
wbb/modules/images.py

@@ -38,8 +38,9 @@ async def wall(_, message):
     initial_term = message.text.split(None, 1)[1]
     initial_term = message.text.split(None, 1)[1]
     m = await message.reply_text("Searching!")
     m = await message.reply_text("Searching!")
     term = initial_term.replace(' ', '%20')
     term = initial_term.replace(' ', '%20')
-    wallpapers = await arq.wall(term)
-    if not wallpapers:
+    try:
+        wallpapers = await arq.wall(term)
+    except KeyError:
         await m.edit("Found literally nothing!,"
         await m.edit("Found literally nothing!,"
                      + "You should work on your English.")
                      + "You should work on your English.")
         return
         return