[somebot] /plenum
authorSomeone <someone@somenet.org>
Wed, 8 Dec 2021 18:38:38 +0000 (19:38 +0100)
committerSomeone <someone@somenet.org>
Wed, 8 Dec 2021 18:38:38 +0000 (19:38 +0100)
modules/CommandPlenum.py [new file with mode: 0644]

diff --git a/modules/CommandPlenum.py b/modules/CommandPlenum.py
new file mode 100644 (file)
index 0000000..7eccf91
--- /dev/null
@@ -0,0 +1,36 @@
+# Mattermost Bot module.
+#  Copyright (c) 2016-2021 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
+#  published under MIT-License
+
+from inspect import cleandoc
+
+
+from AbstractCommand import AbstractCommand
+class CommandPlenum(AbstractCommand):
+    TRIGGER = "plenum"
+    CONFIG = {"display_name": "somebot-command", "auto_complete": True,
+              "auto_complete_hint": "['oida'|'oidaaa']",
+             }
+    CONFIG["auto_complete_desc"] = CONFIG["description"] = "Remind of plenum."
+    USEINFO = cleandoc("""
+        Use ``/plenum`` optionally with one of the following arguments ``'oida'|'oidaaa'`` to remind a person to come to plenum.
+        """)
+
+
+    def on_POST(self, request, data):
+        msg = "## ``Plenum ist bald!``\nDa dies unser wichtigstes Entscheidungsfindungsgremium ist, wär es cool, wenn auch du vorbeischauen würdest. @all\n:warning: https://talk.fsinf.at/plenum\n"
+
+        if data["text"] == "":
+            pass
+
+        elif data["text"] == "oida":
+            msg = "***"+msg.upper()+"***"
+
+        elif data["text"] == "oidaaa":
+            msg = "PLEEEEeeEeEEnum... PleeEeeeEEeeEEeeeeeEeEeeeeeenum ...\nhttps://www.youtube.com/watch?v=Y3-VTt5CMUM @all"
+
+        else:
+            request.cmd_respond_text_temp("Die zulässigen Parameter sind: nichts, 'oida', 'oidaaa'. :)")
+            return
+
+        request.cmd_respond_text_chan(msg)