]> git.somenet.org - pub/jan/mattermost.git/blob - somebot/modules/CommandOrder.py
[somebot] /spoiler-adv <post-permalink> <spoiler-text>
[pub/jan/mattermost.git] / somebot / modules / CommandOrder.py
1 # Mattermost Bot.
2 #  Copyright (c) 2016-2020 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
3 #  published under MIT-License
4
5 import inspect
6
7
8 from AbstractCommand import *
9 class CommandOrder(AbstractCommand):
10     TRIGGER = "order"
11     CONFIG = {"display_name": "somebot-command", "auto_complete": True,
12               "auto_complete_hint": "['oida'|'oida minusf']",
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"] == "oida":
19             request.cmd_respond_text_chan("## **``ORDER! OIDA!``**\n# :boom::hammer: :boom::hammer: :boom::hammer:\nRespect this channel's purpose!")
20
21         elif data["text"] == "oida minusf":
22             request.cmd_respond_text_chan(inspect.cleandoc("""
23                 ## :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:
24                 ## :point_right: **``ORDER! OIDA!``**
25                 # :point_right: :boom::hammer: :boom::hammer: :boom::hammer: :boom::hammer: :boom::hammer:
26                 ## :point_right: **``This channel's purpose! OIDA!``**
27                 ## :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:
28                 """))
29         else:
30             request.cmd_respond_text_chan("## **``ORDER! OOORDER!``**\n# :boom::hammer:\nRespect this channel's purpose!")
31