def on_POST(self, request, data):
msg = ""
- for c in self.bot.api.get_team_channels(self.TEAM_ID):
- if not c["id"] in self.skip_chann_ids:
- self.bot.api.add_user_to_channel(c["id"], data["user_id"])
- msg += "\n + ~"+c["name"]
+ for chan in self.bot.api.get_team_channels(self.TEAM_ID):
+ if not chan["id"] in self.skip_chann_ids:
+ self.bot.api.add_user_to_channel(chan["id"], data["user_id"])
+ msg += "\n + ~"+chan["name"]
request.respond_cmd_temp("## :white_check_mark: Success! :)\nYou joined all the public channels in the team:\n{}\nA reload might be needed to display the updated list of channels".format(msg))