From b9b7a6ca27cdcd98a4db5ece30b1baee4c36bc59 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Fri, 17 Nov 2023 14:48:29 +1100 Subject: [PATCH] more schedulebot formatting --- zulip_bots/zulip_bots/schedulebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip_bots/zulip_bots/schedulebot.py b/zulip_bots/zulip_bots/schedulebot.py index fd316d4..67b91fd 100644 --- a/zulip_bots/zulip_bots/schedulebot.py +++ b/zulip_bots/zulip_bots/schedulebot.py @@ -100,7 +100,7 @@ def post_schedule(client, send_client, start_time, schedule, stream, hour, no_me supervisor = user_id if user_id not in display_names: display_names[user_id] = gevent.spawn(get_display_name, client, user_id) - if now in ("Chatops", "Editor", "Sheeter"): + if now.lower() in ("chatops", "editor", "sheeter"): online_by_role.setdefault(now, []).append(user_id) if user_id not in display_names: display_names[user_id] = gevent.spawn(get_display_name, client, user_id) @@ -176,7 +176,7 @@ def post_schedule(client, send_client, start_time, schedule, stream, hour, no_me ] for role, user_ids in sorted(online_by_role.items()): user_ids.sort() - lines.append("Current {}(s): {}".format( + lines.append("Current {}: {}".format( role + ("" if role.endswith("s") else "s"), # bad attempt at pluralization ", ".join(render_name(user_id, False) for user_id in user_ids), ))