# PR Description
* Adds/updates the following files to all toolkits:
- `.pre-commit-config.yaml`
- `.ruff.toml`
- `LICENSE`
- `Makefile`
- `pyproject.toml`
* Lint all toolkits such that they pass `make check` and `make test` (a
total doozy). This includes adding some unit tests and evals.
* Github workflow for testing toolkits before merge into main (courtesy
of @sdreyer)
* Added a QOL improvement for tool developers for when they need to get
the context's auth token.
* Minor updates to `arcade new` template.
20 lines
771 B
Python
20 lines
771 B
Python
from slack_sdk.web import SlackResponse
|
|
|
|
|
|
def format_channels(channels_response: SlackResponse) -> str:
|
|
csv_string = "All active Slack channels:\n\nname\n"
|
|
for channel in channels_response["channels"]:
|
|
if not channel.get("is_archived", False):
|
|
name = channel.get("name", "")
|
|
csv_string += f"{name}\n"
|
|
return csv_string.strip()
|
|
|
|
|
|
def format_users(userListResponse: SlackResponse) -> str:
|
|
csv_string = "All active Slack users:\n\nname,real_name\n"
|
|
for user in userListResponse["members"]:
|
|
if not user.get("deleted", False):
|
|
name = user.get("name", "")
|
|
real_name = user.get("profile", {}).get("real_name", "")
|
|
csv_string += f"{name},{real_name}\n"
|
|
return csv_string.strip()
|