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,5 +47,6 @@ $ 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.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).

30 changes: 30 additions & 0 deletions methods/src/main/java/slackbot/skills/SlackbotSkillsList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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.SlackbotSkillsListRequest;

Check failure on line 6 in methods/src/main/java/slackbot/skills/SlackbotSkillsList.java

View workflow job for this annotation

GitHub Actions / maven@java17 (methods)

package com.slack.api.methods.request.slackbot.skills does not exist
import com.slack.api.methods.response.slackbot.skills.SlackbotSkillsListResponse;

Check failure on line 7 in methods/src/main/java/slackbot/skills/SlackbotSkillsList.java

View workflow job for this annotation

GitHub Actions / maven@java17 (methods)

package com.slack.api.methods.response.slackbot.skills does not exist
import java.io.IOException;

public class SlackbotSkillsList {

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.list method
SlackbotSkillsListRequest request = SlackbotSkillsListRequest.builder()
.filter("library")
.category("productivity")
.limit(100)
.build();
SlackbotSkillsListResponse response = methods.slackbotSkillsList(request);

// Inspect the response
System.out.println(response);
}
}
Loading