Skip to content

Commit c59edf0

Browse files
zimegClaude
andauthored
feat(methods): add slackbot.skills.delete method example (#123)
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 6e48411 commit c59edf0

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
5353
### slackbot
5454

5555
- **[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).
56+
- **[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/main/java/slackbot/skills/SlackbotSkillsDelete.java).
5657
- **[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).
5758
- **[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).
5859
- **[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).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package slackbot.skills;
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.SlackbotSkillsDeleteRequest;
7+
import com.slack.api.methods.response.slackbot.skills.SlackbotSkillsDeleteResponse;
8+
import java.io.IOException;
9+
10+
public class SlackbotSkillsDelete {
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.delete method
20+
SlackbotSkillsDeleteRequest request =
21+
SlackbotSkillsDeleteRequest.builder().skillId("F0123ABCD").build();
22+
SlackbotSkillsDeleteResponse response = methods.slackbotSkillsDelete(request);
23+
24+
// Inspect the response
25+
System.out.println(response);
26+
}
27+
}

0 commit comments

Comments
 (0)