diff --git a/methods/README.md b/methods/README.md index 7bf92a97..346cc8d8 100644 --- a/methods/README.md +++ b/methods/README.md @@ -69,6 +69,7 @@ $ slack run chat_post_message.py # Make the request ### slackbot +- **[slackbot.skillSets.create](https://docs.slack.dev/reference/methods/slackbot.skillSets.create)**: Creates an empty, private Slackbot skill set and attempts to add it to the caller's library. [Implementation](./src/slackbot/skillSets/slackbot_skill_sets_create.py). - **[slackbot.skills.create](https://docs.slack.dev/reference/methods/slackbot.skills.create)**: Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. [Implementation](./src/slackbot/skills/slackbot_skills_create.py). - **[slackbot.skills.delete](https://docs.slack.dev/reference/methods/slackbot.skills.delete)**: Deletes a Slackbot skill and its canvas, and removes it from every library, skill set, and the org catalog. [Implementation](./src/slackbot/skills/slackbot_skills_delete.py). - **[slackbot.skills.info](https://docs.slack.dev/reference/methods/slackbot.skills.info)**: Returns one Slackbot skill, including its instructions. [Implementation](./src/slackbot/skills/slackbot_skills_info.py). diff --git a/methods/pyproject.toml b/methods/pyproject.toml index 45277854..4cbacaf4 100644 --- a/methods/pyproject.toml +++ b/methods/pyproject.toml @@ -4,7 +4,7 @@ version = "0.0.0" requires-python = ">=3.10" dependencies = [ "slack_cli_hooks==0.3.0", - "slack_sdk==3.48.0", + "slack_sdk==3.48.1", ] [project.optional-dependencies] diff --git a/methods/src/slackbot/skillSets/.slack/.gitignore b/methods/src/slackbot/skillSets/.slack/.gitignore new file mode 100644 index 00000000..973ba605 --- /dev/null +++ b/methods/src/slackbot/skillSets/.slack/.gitignore @@ -0,0 +1,2 @@ +apps.dev.json +cache/ diff --git a/methods/src/slackbot/skillSets/.slack/config.json b/methods/src/slackbot/skillSets/.slack/config.json new file mode 100644 index 00000000..909afbe1 --- /dev/null +++ b/methods/src/slackbot/skillSets/.slack/config.json @@ -0,0 +1,6 @@ +{ + "manifest": { + "source": "local" + }, + "project_id": "00000000-0000-0000-0000-000000000000" +} diff --git a/methods/src/slackbot/skillSets/.slack/hooks.json b/methods/src/slackbot/skillSets/.slack/hooks.json new file mode 100644 index 00000000..ce474c9a --- /dev/null +++ b/methods/src/slackbot/skillSets/.slack/hooks.json @@ -0,0 +1,5 @@ +{ + "hooks": { + "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks" + } +} diff --git a/methods/src/slackbot/skillSets/__init__.py b/methods/src/slackbot/skillSets/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/methods/src/slackbot/skillSets/assets/icon.png b/methods/src/slackbot/skillSets/assets/icon.png new file mode 100644 index 00000000..7f4b786d Binary files /dev/null and b/methods/src/slackbot/skillSets/assets/icon.png differ diff --git a/methods/src/slackbot/skillSets/manifest.json b/methods/src/slackbot/skillSets/manifest.json new file mode 100644 index 00000000..d4c7a306 --- /dev/null +++ b/methods/src/slackbot/skillSets/manifest.json @@ -0,0 +1,22 @@ +{ + "display_information": { + "name": "Slack API Methods", + "description": "Example implementations to call \"slackbot.skillSets\" methods" + }, + "features": { + "bot_user": { + "display_name": "Slack API Methods", + "always_online": true + } + }, + "oauth_config": { + "scopes": { + "bot": ["skills:read", "skills:write"] + } + }, + "settings": { + "org_deploy_enabled": true, + "socket_mode_enabled": false, + "token_rotation_enabled": false + } +} diff --git a/methods/src/slackbot/skillSets/slackbot_skill_sets_create.py b/methods/src/slackbot/skillSets/slackbot_skill_sets_create.py new file mode 100644 index 00000000..7516e3ab --- /dev/null +++ b/methods/src/slackbot/skillSets/slackbot_skill_sets_create.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the slackbot.skillSets.create method +response = client.slackbot_skillSets_create( + display_name="Sales toolkit", + description="Skills for preparing customer calls and following up on deals.", +) + +# Inspect the response +print(response)