2 # Copyright (c) 2016-2020 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
3 # published under MIT-License
8 from AbstractCommand import *
9 class CommandThreads(AbstractCommand):
11 CONFIG = {"display_name": "somebot-command", "auto_complete": True,
12 "auto_complete_hint": "['bitte'|'BITTE'|'oida'|'oidaaa'|'oida minusf'|'oida?']",
14 CONFIG["auto_complete_desc"] = CONFIG["description"] = "Remind of thread usage."
15 USEINFO = inspect.cleandoc("""
16 Use ``/threads`` optionally with one of the following arguments ``'bitte'|'BITTE'|'oida'|'oidaaa'|'oida minusf'|'oida?'`` to remind a person to use threads.
20 def on_POST(self, request, data):
21 msg = "Mattermost verwendet Threads, um die Kommunikation übersichtlicher zu gestalten.\nDu kannst den Thread-View mit Shift+up, oder dem kleinen Pfeil beim Post rechts oben öffnen."
23 if data["text"] == "":
26 elif data["text"] == "oida":
27 msg = "***"+msg.upper()+"***"
29 elif data["text"] == "bitte":
30 msg = "Bitte verwende Threads, um die Kommunikation übersichtlicher zu gestalten.\nThread-view öffnen mit: shift+up, oder dem kleinen Pfeil."
32 elif data["text"] == "BITTE":
33 msg = "Bitte verwende Threads, um die Kommunikation übersichtlicher zu gestalten.\nThread-view öffnen mit: shift+up, oder dem kleinen Pfeil."
34 msg = "***"+msg.upper()+"***"
36 elif data["text"] == "oidaaa":
37 msg = ("## :warning::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down:\n"
38 "## :point_right: BITTE VERWENDE ``THREADS``, UM DIE KOMMUNIKATION ÜBERSICHTLICHER ZU GESTALTEN.\n"
39 "## :point_right: THREAD-VIEW ÖFFNEN MIT: SHIFT+UP, ODER DEM KLEINEN PFEIL.\n"
40 "## :warning::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up:"
43 elif data["text"] == "oida?":
44 msg = "``/threads`` ... oida?\n-> https://www.youtube.com/watch?v=iuXR53ex4iI"
46 elif data["text"] == "oida minusf":
47 msg = ("## :warning::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down:\n"
48 "## :point_right: ``OIDA! THREADS OIDA!``\n"
49 "## :point_right: ``OIDA, OIDA, THREAD-VIEW OIDA, OIDA.``\n"
50 "## :warning::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up::point_up_2::point_up:\n"
54 request.cmd_respond_text_temp("Die zulässigen Parameter sind: nichts, 'bitte', 'BITTE', 'oida', 'oidaaa', 'oida minusf'. :)")
57 request.cmd_respond_text_chan(msg)