Kirk Trombley il y a 4 ans
Parent
commit
0aaa4c1e28
1 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. 11 0
      src/plugins/querying.py

+ 11 - 0
src/plugins/querying.py

@@ -220,6 +220,17 @@ def cat(message):
     return run_upload(message, r.content)
 
 
+@with_help("The !horse command grabs a cat from https://thishorsedoesnotexist.com/")
+@as_plugin
+def horse(message):
+    try:
+        r = requests.get("https://thishorsedoesnotexist.com/", headers={ "User-Agent": "Rollbot" })
+    except ConnectionError as e:
+        return RollbotFailure.SERVICE_DOWN.with_reason("Could not reach horse generator.").with_exception(e)
+
+    return run_upload(message, r.content)
+
+
 @with_help("The !npc command grabs a person from https://thispersondoesnotexist.com/")
 @as_plugin
 def npc(message):