Ver Fonte

Add 'src/plugins/the_house.py'

My rough draft for a variant of the guy which prints the house, plus the person's name
iramo94 há 6 anos atrás
pai
commit
46d416656b
1 ficheiros alterados com 25 adições e 0 exclusões
  1. 25 0
      src/plugins/the_house.py

+ 25 - 0
src/plugins/the_house.py

@@ -0,0 +1,25 @@
+from command_system import RollbotResponse, RollbotFailure, as_plugin
+
+housetop = """\
+┏┓
+┃┃╱╲ In this
+┃╱╱╲╲ house
+╱╱╭╮╲╲ we love
+▔▏┗┛▕▔ & appreciate
+╱▔▔▔▔▔▔▔▔▔▔╲
+"""
+
+housebot = """\
+╱╱┏┳┓╭╮┏┳┓ ╲╲
+▔▏┗┻┛┃┃┗┻┛▕▔
+"""
+
+@as_plugin("hey")
+def the_house(db, msg):
+    for x, y in zip(msg.args(), ("can", "i", "have", "the", "house", "with")):
+        if x.lower() != y:
+            return RollbotResponse(msg, failure=RollbotFailure.INVALID_ARGUMENTS)
+	
+	thehouse = housetop + msg.args().last() + housebot
+
+    return RollbotResponse(msg, txt=thehouse)