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