From d9840173b55f779229e331af2e53401d79dd1d7d Mon Sep 17 00:00:00 2001 From: Someone Date: Sun, 9 Jan 2022 00:57:52 +0100 Subject: [PATCH] modules/TACommandAnnounceAll.py --- modules/TACommandAnnounceAll.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/TACommandAnnounceAll.py b/modules/TACommandAnnounceAll.py index 4144a56..348cff5 100644 --- a/modules/TACommandAnnounceAll.py +++ b/modules/TACommandAnnounceAll.py @@ -4,7 +4,7 @@ -from AbstractCommand import * +from AbstractCommand import AbstractCommand class TACommandAnnounceAll(AbstractCommand): TRIGGER = "ta-announce-all" CONFIG = {"display_name": "somebot-command", "auto_complete": True, @@ -19,13 +19,12 @@ 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"]) or self._require_team_admin(data, exc=False): - if False: + if ("roles" in user and "team_admin" in user["roles"]) or 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"]) + #self.bot.api.create_post(channel["id"], data["text"]) posted_to += "\n+ "+t["name"] if posted_to != "": - request.respond_cmd_temp("## :white_check_mark: Success! :)\n### Posted to:"+posted_to) + request.respond_cmd_temp("## :white_check_mark: Success! :)\n#### Posted to:"+posted_to) else: request.respond_cmd_err("Did not post anything. Are you a Team-Admin anywhere?") -- 2.43.0