diff --git a/methods/README.md b/methods/README.md index e0d5daa..116b52a 100644 --- a/methods/README.md +++ b/methods/README.md @@ -53,6 +53,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques ### slackbot - **[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.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). - **[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.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). diff --git a/methods/src/main/java/slackbot/skills/SlackbotSkillsDelete.java b/methods/src/main/java/slackbot/skills/SlackbotSkillsDelete.java new file mode 100644 index 0000000..c8e303a --- /dev/null +++ b/methods/src/main/java/slackbot/skills/SlackbotSkillsDelete.java @@ -0,0 +1,27 @@ +package slackbot.skills; + +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.SlackbotSkillsDeleteRequest; +import com.slack.api.methods.response.slackbot.skills.SlackbotSkillsDeleteResponse; +import java.io.IOException; + +public class SlackbotSkillsDelete { + + 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.delete method + SlackbotSkillsDeleteRequest request = + SlackbotSkillsDeleteRequest.builder().skillId("F0123ABCD").build(); + SlackbotSkillsDeleteResponse response = methods.slackbotSkillsDelete(request); + + // Inspect the response + System.out.println(response); + } +}