diff --git a/coroutines/__init__.py b/coroutines/__init__.py index 1e84fa6..9c27359 100644 --- a/coroutines/__init__.py +++ b/coroutines/__init__.py @@ -8,9 +8,12 @@ from coroutines.rss import RSS # def test(bot): # print("Testing {}".format(bot.botnick)) +def use(cls): + return lambda state: cls(state).start() + coroutines = [ { - "worker": lambda state: BBJ(state).start(), + "worker": use(BBJ), "interval": 5, "state": { "alias": "bbj", @@ -19,7 +22,7 @@ coroutines = [ } }, { - "worker": lambda state: RSS(state).start(), + "worker": use(RSS), "interval": 6, "state": { "alias": "title", @@ -29,7 +32,7 @@ coroutines = [ } }, { - "worker": lambda state: RSS(state).start(), + "worker": use(RSS), "interval": 8, "state": { "alias": "links-comments",