| Constructor and Description |
|---|
ShortcutImpl(Slack slack) |
ShortcutImpl(Slack slack,
ApiToken apiToken) |
| Modifier and Type | Method and Description |
|---|---|
ReactionsAddResponse |
addReaction(Message message,
ReactionName reactionName)
Adds a reaction to a specified message.
|
Optional<ChannelId> |
findChannelIdByName(ChannelName name)
Returns ChannelId corresponding to a given channel name if exists.
|
Optional<ChannelName> |
findChannelNameById(ChannelId channelId)
Returns a channel's human readable name corresponding to a given channel id if exists.
|
List<Message> |
findRecentMessagesByName(ChannelName name)
Returns a list of messages in the channel a given name matches.
|
List<Message> |
findRecentMessagesByName(ChannelName name,
int limit) |
ChatPostMessageResponse |
post(ChannelName channel,
List<LayoutBlock> blocks)
Posts a message to a given channel.
|
ChatPostMessageResponse |
post(ChannelName channel,
String text)
Posts a message to a given channel.
|
ChatPostMessageResponse |
post(ChannelName channel,
String text,
List<Attachment> attachments)
Posts a message to a given channel.
|
ChatPostMessageResponse |
postAsBot(ChannelName channel,
List<LayoutBlock> blocks) |
ChatPostMessageResponse |
postAsBot(ChannelName channel,
String text) |
ChatPostMessageResponse |
postAsBot(ChannelName channel,
String text,
List<Attachment> attachments) |
SearchAllResponse |
search(String query)
Returns search result by a given query.
|
void |
updateChannelsCache()
Shortcut internally has a cache for channels API response.
|
public ShortcutImpl(Slack slack)
public Optional<ChannelId> findChannelIdByName(ChannelName name) throws IOException, SlackApiException
ShortcutfindChannelIdByName in interface ShortcutIOExceptionSlackApiExceptionpublic Optional<ChannelName> findChannelNameById(ChannelId channelId)
ShortcutfindChannelNameById in interface Shortcutpublic List<Message> findRecentMessagesByName(ChannelName name) throws IOException, SlackApiException
ShortcutfindRecentMessagesByName in interface ShortcutIOExceptionSlackApiExceptionpublic List<Message> findRecentMessagesByName(ChannelName name, int limit) throws IOException, SlackApiException
findRecentMessagesByName in interface ShortcutIOExceptionSlackApiExceptionpublic ReactionsAddResponse addReaction(Message message, ReactionName reactionName) throws IOException, SlackApiException
ShortcutaddReaction in interface ShortcutIOExceptionSlackApiExceptionpublic SearchAllResponse search(String query) throws IOException, SlackApiException
Shortcutsearch in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse post(ChannelName channel, String text) throws IOException, SlackApiException
Shortcutpost in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse postAsBot(ChannelName channel, String text) throws IOException, SlackApiException
postAsBot in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse post(ChannelName channel, String text, List<Attachment> attachments) throws IOException, SlackApiException
Shortcutpost in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse postAsBot(ChannelName channel, String text, List<Attachment> attachments) throws IOException, SlackApiException
postAsBot in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse post(ChannelName channel, List<LayoutBlock> blocks) throws IOException, SlackApiException
Shortcutpost in interface ShortcutIOExceptionSlackApiExceptionpublic ChatPostMessageResponse postAsBot(ChannelName channel, List<LayoutBlock> blocks) throws IOException, SlackApiException
postAsBot in interface ShortcutIOExceptionSlackApiExceptionpublic void updateChannelsCache()
throws IOException,
SlackApiException
ShortcutupdateChannelsCache in interface ShortcutIOExceptionSlackApiExceptionCopyright © 2019. All Rights Reserved.