From 0387e3b3954364bd6ca7096ef366851e06cb7d85 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Thu, 21 Mar 2019 10:23:11 +0100 Subject: [PATCH] Add hero comment getter --- cbgetter.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cbgetter.py b/cbgetter.py index 391e2dd..41237d8 100644 --- a/cbgetter.py +++ b/cbgetter.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """Get data from database and publish them.""" from json import dumps +from random import randint from requests import post from cbconf import Conf from cbdb import Db @@ -20,3 +21,24 @@ class CoffeebotGetter: def sendMsgToSlack(self): """Send message to Slack Bot.""" return post(self.cfg.getCoffeebotURL(), dumps({"text": self.msg})) + + def getHeroComment(self): + """Return comment for hero.""" + hsuff = [ + " - yes", + " - no", + " - maybe", + #", oops", + #" - real hero", + #" because couldn't resist", + #" - drunken master", + #", woohoo", + #" - unbeatable", + #" - superultramaxidrinker", + #" and didn't sleep last week", + #" in last 604800 seconds", + #", no idea how", + #" and still drinking", + ] + ri = randint(0, len(hsuff) - 1) + return hsuff[ri] -- 2.39.2