Skip to content

Commit 6a3d4aa

Browse files
zimegClaude
andauthored
feat(methods): add slackbot.skills.library.remove method example (#118)
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent c1cb625 commit 6a3d4aa

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
4848
- **[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).
4949
- **[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).
5050
- **[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).
51+
- **[slackbot.skills.library.remove](https://docs.slack.dev/reference/methods/slackbot.skills.library.remove)**: Turns a skill off in the caller's personal library. [Implementation](./src/main/java/slackbot/skills/library/SlackbotSkillsLibraryRemove.java).
5152
- **[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).
5253
- **[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).
5354

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package slackbot.skills.library;
2+
3+
import com.slack.api.Slack;
4+
import com.slack.api.methods.MethodsClient;
5+
import com.slack.api.methods.SlackApiException;
6+
import com.slack.api.methods.request.slackbot.skills.library.SlackbotSkillsLibraryRemoveRequest;
7+
import com.slack.api.methods.response.slackbot.skills.library.SlackbotSkillsLibraryRemoveResponse;
8+
import java.io.IOException;
9+
10+
public class SlackbotSkillsLibraryRemove {
11+
12+
public static void main(String[] args) throws IOException, SlackApiException {
13+
// Read a token from an environment variable
14+
String token = System.getenv("SLACK_TOKEN");
15+
16+
// Initialize
17+
MethodsClient methods = Slack.getInstance().methods(token);
18+
19+
// Call the slackbot.skills.library.remove method
20+
SlackbotSkillsLibraryRemoveRequest request = SlackbotSkillsLibraryRemoveRequest.builder()
21+
.skillId("F0123ABCD")
22+
.build();
23+
SlackbotSkillsLibraryRemoveResponse response = methods.slackbotSkillsLibraryRemove(request);
24+
25+
// Inspect the response
26+
System.out.println(response);
27+
}
28+
}

0 commit comments

Comments
 (0)