babili-bot/coroutines/__init__.py

44 lines
973 B
Python

from coroutines.bbj import BBJ
from coroutines.rss import RSS
# {
# "worker": test,
# "interval": 3
# }
# def test(bot):
# print("Testing {}".format(bot.botnick))
def use(cls):
return lambda state: cls(state).start()
coroutines = [
{
"worker": use(BBJ),
"interval": 5,
"state": {
"alias": "bbj",
"source": "http://localhost:7099/api",
"channels": ["#team"]
}
},
{
"worker": use(RSS),
"interval": 6,
"state": {
"alias": "links",
"source": "https://tilde.news/newest.rss",
"use": "title",
"channels": ["#meta", "#tildeverse"]
}
},
{
"worker": use(RSS),
"interval": 8,
"state": {
"alias": "links-comments",
"source": "https://tilde.news/comments.rss",
"use": "description",
"channels": ["#tildeverse"]
}
}
]