From 8e6e2cdf9b5807496bd71b1652f89c0288b76913 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sat, 5 Nov 2022 14:42:27 +1100 Subject: [PATCH] allow yaml config --- zulip/schedulebot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulip/schedulebot.py b/zulip/schedulebot.py index 0cc37d2..a45303b 100644 --- a/zulip/schedulebot.py +++ b/zulip/schedulebot.py @@ -10,6 +10,7 @@ from datetime import datetime, timedelta import gevent.pool import argh +import yaml import requests session = requests.Session() @@ -196,7 +197,7 @@ def main(conf_file, hour=-1, no_groups=False, stream="General", no_mentions=Fals authentication is an object {email, api_key} """ with open(conf_file) as f: - config = json.load(f) + config = yaml.safe_load(f) client = Client(config["url"], config["api_user"]["email"], config["api_user"]["api_key"]) send_auth = config.get("send_user", config["api_user"]) send_client = Client(config["url"], send_auth["email"], send_auth["api_key"])