TheHamkerCat 5 年之前
父节点
当前提交
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]
     m = await message.reply_text("Searching!")
     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!,"
                      + "You should work on your English.")
         return