]> git.somenet.org - pub/jan/mattermost-bot.git/blob - modules/CommandOrder.py
modules/CommandBeratungsinfo.py
[pub/jan/mattermost-bot.git] / modules / CommandOrder.py
1 # Mattermost Bot module.
2 #  Copyright (c) 2016-2021 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 from AbstractCommand import AbstractCommand
9 class CommandOrder(AbstractCommand):
10     TRIGGER = "order"
11     CONFIG = {"display_name": "somebot-command", "auto_complete": True,
12               "auto_complete_hint": "['oida'|'oida minusf'|'--video']",
13              }
14     USEINFO = CONFIG["auto_complete_desc"] = CONFIG["description"] = "Call for order."
15
16
17     def on_POST(self, request, data):
18         if data["text"] == "":
19             request.cmd_respond_text_chan("## **``ORDER! OOORDER!``**\n# :boom::hammer:\nRespect this channel's purpose!")
20
21         elif data["text"] == "oida":
22             request.cmd_respond_text_chan("## **``ORDER! OIDA!``**\n# :boom::hammer: :boom::hammer: :boom::hammer:\nRespect this channel's purpose!")
23
24         elif data["text"] == "oida minusf":
25             request.cmd_respond_text_chan(cleandoc("""
26                 ## :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:
27                 ## :point_right: **``ORDER! OIDA!``**
28                 # :point_right: :boom::hammer: :boom::hammer: :boom::hammer: :boom::hammer: :boom::hammer:
29                 ## :point_right: **``This channel's purpose! OIDA!``**
30                 ## :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:
31                 """))
32
33         elif data["text"] == "--video":
34             request.cmd_respond_text_chan("## **``ORDER! OOORDER!``**\nhttps://youtu.be/VYycQTm2HrM")
35
36         else:
37             request.cmd_respond_text_temp("Permitted agruments: nothing, `oida`, `oida minusf`, `--video` :)")