From 46f1a2b8b2d6b917e7bc8cff2c5acc04dd122868 Mon Sep 17 00:00:00 2001 From: Someone Date: Fri, 19 Jun 2020 01:32:13 +0200 Subject: [PATCH] [somebot] /threads ["nice"|"oida"|"oidaaa"|"oida?"|"oida!"|"oida minusf"] --- somebot/modules/CommandThreads.py | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 somebot/modules/CommandThreads.py diff --git a/somebot/modules/CommandThreads.py b/somebot/modules/CommandThreads.py new file mode 100644 index 0000000..b1431c8 --- /dev/null +++ b/somebot/modules/CommandThreads.py @@ -0,0 +1,58 @@ +# Mattermost Bot. +# Copyright (c) 2016-2020 by Someone (aka. Jan Vales ) +# published under MIT-License + +import inspect + + +from AbstractCommand import * +class CommandThreads(AbstractCommand): + TRIGGER = "threads" + CONFIG = {"display_name": "somebot-command", "auto_complete": True, + "auto_complete_hint": "['bitte'|'BITTE'|'oida'|'oidaaa'|'oida minusf'|'oida?']", + } + CONFIG["auto_complete_desc"] = CONFIG["description"] = "Remind of thread usage." + USEINFO = inspect.cleandoc(""" + Use ``/threads`` optionally with one of the following arguments ``'bitte'|'BITTE'|'oida'|'oidaaa'|'oida minusf'|'oida?'`` to remind a person to use threads. + """) + + + def on_POST(self, request, data): + 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." + + if data["text"] == "": + pass + + elif data["text"] == "oida": + msg = "***"+msg.upper()+"***" + + elif data["text"] == "bitte": + msg = "Bitte verwende Threads, um die Kommunikation übersichtlicher zu gestalten.\nThread-view öffnen mit: shift+up, oder dem kleinen Pfeil." + + elif data["text"] == "BITTE": + msg = "Bitte verwende Threads, um die Kommunikation übersichtlicher zu gestalten.\nThread-view öffnen mit: shift+up, oder dem kleinen Pfeil." + msg = "***"+msg.upper()+"***" + + elif data["text"] == "oidaaa": + 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" + "## :point_right: BITTE VERWENDE ``THREADS``, UM DIE KOMMUNIKATION ÜBERSICHTLICHER ZU GESTALTEN.\n" + "## :point_right: THREAD-VIEW ÖFFNEN MIT: SHIFT+UP, ODER DEM KLEINEN PFEIL.\n" + "## :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:" + ) + + elif data["text"] == "oida?": + msg = "``/threads`` ... oida?\n-> https://www.youtube.com/watch?v=iuXR53ex4iI" + + elif data["text"] == "oida minusf": + 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" + "## :point_right: ``OIDA! THREADS OIDA!``\n" + "## :point_right: ``OIDA, OIDA, THREAD-VIEW OIDA, OIDA.``\n" + "## :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" + ) + + else: + request.cmd_respond_text_temp("Die zulässigen Parameter sind: nichts, 'bitte', 'BITTE', 'oida', 'oidaaa', 'oida minusf'. :)") + return + + request.cmd_respond_text_chan(msg) + -- 2.43.0