Skip to content

Instantly share code, notes, and snippets.

@shestakow1993
Created October 11, 2018 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shestakow1993/6b5c403badf405ae01084dbea251ed7e to your computer and use it in GitHub Desktop.
Save shestakow1993/6b5c403badf405ae01084dbea251ed7e to your computer and use it in GitHub Desktop.
/**
* Sends notifications with params from enum @SlackChats.class
*/
public class Notification {
/**
*
* @param message string messages text
* @param slackChats CONSTANT from SlackChat
*/
public static void sendMessage(String message, SlackChats slackChats){
SlackApi api = new SlackApi(slackChats.getAddress());
try {
api.call(new SlackMessage(message));
}catch (IOException e) {
System.out.println(message + " message don't send slack");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment