]> git.somenet.org - pub/jan/mattermost-bot.git/blob - modules/CommandToss.py
core/AbstractCommand.py
[pub/jan/mattermost-bot.git] / modules / CommandToss.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 import requests
6
7
8 # pylint: disable=wrong-import-position
9 from AbstractCommand import AbstractCommand
10 class CommandToss(AbstractCommand):
11     TRIGGER = "toss"
12     CONFIG = {"display_name": "somebot-command", "auto_complete": True,
13               "auto_complete_hint": "<any search term>",
14              }
15     USEINFO = CONFIG["auto_complete_desc"] = CONFIG["description"] = AbstractCommand.ICON_PUBLIC+"Use toss.fsinf.at"
16
17
18     def on_POST(self, request, data):
19         request.respond_cmd_chan("#### Let me :toss: that for you :)\n:arrow_right: https://toss.fsinf.at/?q="+requests.utils.quote(data["text"]))