]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/commitdiff
Add hero comment getter
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 21 Mar 2019 09:23:11 +0000 (10:23 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 21 Mar 2019 13:34:02 +0000 (14:34 +0100)
cbgetter.py

index 391e2dd7e4d0b8e914624940a028384c64f2c699..41237d8a13ef93e4022d78c7e457efb9946f5ba3 100644 (file)
@@ -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]