Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions methods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques

- **[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/main/java/slackbot/skills/SlackbotSkillsCreate.java).
- **[slackbot.skills.info](https://docs.slack.dev/reference/methods/slackbot.skills.info)**: Returns one Slackbot skill, including its instructions. [Implementation](./src/main/java/slackbot/skills/SlackbotSkillsInfo.java).
- **[slackbot.skills.library.add](https://docs.slack.dev/reference/methods/slackbot.skills.library.add)**: Turns a skill on in the caller's personal library. [Implementation](./src/main/java/slackbot/skills/library/SlackbotSkillsLibraryAdd.java).
- **[slackbot.skills.list](https://docs.slack.dev/reference/methods/slackbot.skills.list)**: Lists Slackbot skills from the caller's point of view. Instructions are not included. [Implementation](./src/main/java/slackbot/skills/SlackbotSkillsList.java).
- **[slackbot.skills.update](https://docs.slack.dev/reference/methods/slackbot.skills.update)**: Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing. [Implementation](./src/main/java/slackbot/skills/SlackbotSkillsUpdate.java).

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package slackbot.skills.library;

import com.slack.api.Slack;
import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.request.slackbot.skills.library.SlackbotSkillsLibraryAddRequest;
import com.slack.api.methods.response.slackbot.skills.library.SlackbotSkillsLibraryAddResponse;
import java.io.IOException;

public class SlackbotSkillsLibraryAdd {

public static void main(String[] args) throws IOException, SlackApiException {
// Read a token from an environment variable
String token = System.getenv("SLACK_TOKEN");

// Initialize
MethodsClient methods = Slack.getInstance().methods(token);

// Call the slackbot.skills.library.add method
SlackbotSkillsLibraryAddRequest request =
SlackbotSkillsLibraryAddRequest.builder().skillId("F0123ABCD").build();
SlackbotSkillsLibraryAddResponse response = methods.slackbotSkillsLibraryAdd(request);

// Inspect the response
System.out.println(response);
}
}
23 changes: 23 additions & 0 deletions methods/src/main/java/slackbot/skills/library/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"display_information": {
"name": "Slack API Methods",
"description": "Example implementations to call \"slackbot.skills.library\" methods"
},
"features": {
"bot_user": {
"display_name": "Slack API Methods",
"always_online": true
}
},
"oauth_config": {
"scopes": {
"bot": ["skills:write"],
"user": ["skills:write"]
}
},
"settings": {
"org_deploy_enabled": true,
"socket_mode_enabled": true,
"token_rotation_enabled": false
}
}
Loading