def index(): ldb = LiteDB() d = ldb.get_one() return render_template('index.html', title='Butler', timestamp=d['ts'], state=d['st'])
def handler(cmd, chn): resp = 'All I can say is that it\'s a bouillon spoon' kw = ['water', 'temperature', 'ready'] if any(w in cmd for w in kw): ldb = LiteDB() d = ldb.get_one() resp = 'Last time I checked ({ts}), it was {st}'.format(ts=d['ts'], st=d['st']) slackc.api_call('chat.postMessage', as_user=True, channel=chn, text=resp)