Class SlackConnector


  • public class SlackConnector
    extends Object
    An small utility for posting messages in slack
    Author:
    José Fernández
    • Constructor Detail

      • SlackConnector

        public SlackConnector()
    • Method Detail

      • getChannels

        public List<String> getChannels​(List<String> tags)
        Parses the provided set of tags and returns all the channels referenced by the slack tag.
        Parameters:
        tags - List of tags (i.e @ignore, @slack(#channel1,#channel2,#channel3))
        Returns:
        A list of all the channels contained in the slack tag (i.e {#channel1,#channel2,#channel3})
      • sendMessageToChannels

        public List<com.slack.api.methods.response.chat.ChatPostMessageResponse> sendMessageToChannels​(List<String> channels,
                                                                                                       String message)
                                                                                                throws com.slack.api.methods.SlackApiException,
                                                                                                       IOException
        Sends the given message to the specified list of channels. For more information and settings, you can check the attached link.
        Parameters:
        channels - List of channels
        message - Text to send
        Returns:
        List of ChatPostMessageResponse
        Throws:
        com.slack.api.methods.SlackApiException - SlackApiException
        IOException - IOException
        See Also:
        Sends a message to a channel.