1 # -*- coding: utf-8 -*-
2 """Get data from database and publish them."""
4 from random import randint
5 from requests import post
6 from cbconf import Conf
10 """This class connects configuration, database access and publishing."""
13 self.db = Db(self.cfg.getCoffeeDbPath())
21 def sendMsgToSlack(self):
22 """Send message to Slack Bot."""
23 return post(self.cfg.getCoffeebotURL(), dumps({"text": self.msg}))
25 def getHeroComment(self):
26 """Return comment for hero."""
33 #" because couldn't resist",
37 #" - superultramaxidrinker",
38 #" and didn't sleep last week",
39 #" in last 604800 seconds",
41 #" and still drinking",
43 ri = randint(0, len(hsuff) - 1)