         }
         safebooru.get '/posts.json', { json: true, qs }
       .then (r)=>
-        try
+        if r.length
           url = "https://safebooru.donmai.us#{r[0].file_url}"
           msg.channel.uploadFile request(url), @getFileName(url)
-        catch
-          console.error r
+        else
+          msg.reply 'No results.'
       .catch (e)=>
         console.error e
         return msg.reply e.msg if e.msg

      }
      safebooru.get '/posts.json', { json: true, qs }
      .then (r)=>
        try
          url = "https://safebooru.donmai.us#{r[0].file_url}"
          msg.channel.uploadFile request(url), @getFileName(url)
        catch
          console.error r
      .catch (e)=>
        console.error e
        msg.reply 'Something went wrong.'

      }
      danbooru.get '/posts.json', { json: true, qs }
      .then (r)=>
        if r.length
          url = "https://danbooru.donmai.us#{r[0].file_url}"
          msg.channel.uploadFile request(url), @getFileName(url)
        else
          msg.reply 'No results.'
      .catch (e)=>
        console.error e
        msg.reply 'Something went wrong.'
