]> git.somenet.org - pub/jan/mattermost-bot.git/blob - modules/CommandPlenum.py
modules/CommandSpoilerAdv.py
[pub/jan/mattermost-bot.git] / modules / CommandPlenum.py
1 # Mattermost Bot module.
2 #  Copyright (c) 2016-2022 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
3 #  published under MIT-License
4
5 from inspect import cleandoc
6
7
8 # pylint: disable=wrong-import-position
9 from AbstractCommand import AbstractCommand
10 class CommandPlenum(AbstractCommand):
11     TRIGGER = "plenum"
12     CONFIG = {"display_name": "somebot-command", "auto_complete": True,
13               "auto_complete_hint": "['oida'|'oidaaa']",
14              }
15     CONFIG["auto_complete_desc"] = CONFIG["description"] = AbstractCommand.ICON_PUBLIC+"Remind of plenum."
16     USEINFO = cleandoc("""
17         Use ``/plenum`` optionally with one of the following arguments ``'oida'|'oidaaa'`` to remind a person to come to plenum.
18         """)
19
20
21     def on_POST(self, request, data):
22         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"
23
24         if data["text"] == "":
25             pass
26
27         elif data["text"] == "oida":
28             msg = "***"+msg.upper()+"***"
29
30         elif data["text"] == "oidaaa":
31             msg = "PLEEEEeeEeEEnum... PleeEeeeEEeeEEeeeeeEeEeeeeeenum ...\nhttps://www.youtube.com/watch?v=Y3-VTt5CMUM @all"
32
33         else:
34             request.respond_cmd_err("``/"+self.TRIGGER+"`` allowed parameters: none, 'oida', 'oidaaa'. :)")
35             return
36
37         request.respond_cmd_chan(msg)