]> git.somenet.org - pub/jan/mattermost.git/blob - somebot/modules/CommandGWGRoll.py
[somebot] /roll
[pub/jan/mattermost.git] / somebot / modules / CommandGWGRoll.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 random
6
7
8 from AbstractCommand import *
9 class CommandGWGRoll(AbstractCommand):
10     TRIGGER = "gwg-roll"
11     CONFIG = {"display_name": "somebot-command", "auto_complete": True,
12         "auto_complete_hint":  "Roll your GWG points!",
13     }
14     USEINFO = CONFIG["auto_complete_desc"] = CONFIG["description"] = "Roll your GWG points!"
15
16     options = ["Your GWG points: "+str(i/10) for i in range(0, 165, 5)]
17
18     def on_POST(self, request, data):
19         request.cmd_respond_text_chan(random.choice(self.options))
20