return Action(msg='%s: %s' % (sender, str(e)))
+class Coin(Worker):
+ binding_keys = [
+ "nick.#.coin.#",
+ "nick.#.münze.#"
+ ]
+ description = "flip a coin"
+ usage = "bot: [...] (coin|münze) [...]"
+
+ def parse_body(self, msg):
+ sender = get_nick_from_message(msg)
+ if "coin" in msg:
+ localized_responses = ["head", "tails"]
+ else:
+ localized_responses = ["kopf", "zahl"]
+ result = random.choice(localized_responses)
+ return Action(msg="{}: {}".format(sender, result))
+
+
class Choose(Worker):
binding_keys = [
"nick.choose.#", "nick.choose",