You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
777 B
Python

import argparse
import asyncio
from .config import load_config
from .bot import send_messages
from .webhook import run_webhook
async def main():
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", default="config.yaml")
args = parser.parse_args()
config = load_config(args.config)
alert_queue = asyncio.Queue()
bot_corout = send_messages(
alert_queue, # Will change in the futur
config.username,
config.homeserver,
config.password,
config.alert_rooms
)
webhook_corout = run_webhook(
alert_queue,
config.host,
config.port
)
await asyncio.gather(
bot_corout,
webhook_corout
)
if __name__ == "__main__":
asyncio.run(main())