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