From 8857783900b8c48b1cc4a489f9c9195e2d09efa1 Mon Sep 17 00:00:00 2001 From: Someone Date: Sun, 9 Jan 2022 00:15:44 +0100 Subject: [PATCH] modules/TACommandAnnounceAll.py --- modules/TACommandAnnounceAll.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/TACommandAnnounceAll.py b/modules/TACommandAnnounceAll.py index cb4ab1a..26e22c6 100644 --- a/modules/TACommandAnnounceAll.py +++ b/modules/TACommandAnnounceAll.py @@ -10,7 +10,7 @@ class TACommandAnnounceAll(AbstractCommand): CONFIG = {"display_name": "somebot-command", "auto_complete": True, "auto_complete_hint": "", } - CONFIG["auto_complete_desc"] = CONFIG["description"] = "Posts into every teams' announcement channel where the poster is a TA. [TEAM_ADMIN]" + CONFIG["auto_complete_desc"] = CONFIG["description"] = "📢 Posts into every teams' announcement channel where the poster is a TA. [TEAM_ADMIN]" def on_POST(self, request, data): @@ -19,12 +19,13 @@ class TACommandAnnounceAll(AbstractCommand): for t in self.bot.api.get_teams(): user = self.bot.api.get_team_member(t["id"], data["user_id"], exc=False) - if "roles" in user and "team_admin" in user["roles"]: + #if ("roles" in user and "team_admin" in user["roles"]) or self._require_team_admin(data, exc=False): + if self._require_team_admin(data, exc=False): channel = self.bot.api.get_channel_by_name(t["id"], "town-square") self.bot.api.create_post(channel["id"], data["text"]) posted_to += "\n+ "+t["name"] if posted_to != "": - request.cmd_respond_text_temp("### ``Done.`` :)\n\nPosted to:"+posted_to) + request.respond_cmd_temp("## :white_check_mark: Success! :)\n### Posted to:"+posted_to) else: - request.cmd_respond_text_temp("### ``Done.`` :(\n\nDid not post anything. Are you a Team-Admin anywhere?") + request.respond_cmd_err("Did not post anything. Are you a Team-Admin anywhere?") -- 2.43.0