All Projects → ashwanthkumar → slack-java-webhook

ashwanthkumar / slack-java-webhook

Licence: other
Java Client to Slack's Webhook feature.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to slack-java-webhook

Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (+4835.82%)
Mutual labels:  slackapi
Node Slack Sdk
Slack Developer Kit for Node.js
Stars: ✭ 2,988 (+4359.7%)
Mutual labels:  slackapi
python-slack-discovery-sdk
This project aims to make using Slack's Discovery APIs easier.
Stars: ✭ 18 (-73.13%)
Mutual labels:  slackapi
git-slack-notify
Sends Slack notifications for new commits in Git repositories
Stars: ✭ 12 (-82.09%)
Mutual labels:  slackapi
techno-boto-slack
A Slack bot written in JavaScript using the official Slack APIs and Node SDK
Stars: ✭ 21 (-68.66%)
Mutual labels:  slackapi
slackbot-destroyer
📣 ❌ Slack integration that can destroy all incoming messages from Slackbot.
Stars: ✭ 33 (-50.75%)
Mutual labels:  slackapi
slacking
Modern Slack C++ 11 library for communicating with the Web Slack API
Stars: ✭ 58 (-13.43%)
Mutual labels:  slackapi

Build Status

slack-java-webhook

Java Client to Slack's Webhook feature.

Dependencies

For Maven,

<dependency>
  <groupId>in.ashwanthkumar</groupId>
  <artifactId>slack-java-webhook</artifactId>
  <version>${slack-java-webhook.version}</version>
</dependency>

For SBT,

libraryDependencies += "in.ashwanthkumar" % "slack-java-webhook" % scalaJavaWebhookVersion

Latest version of slack-java-webhook is scala-java-webhook on Maven Central

Usage

// Using SlackMessage
new Slack(webhookUrl)
    .icon(":smiling_imp:") // Ref - http://www.emoji-cheat-sheet.com/
    .sendToUser("slackbot")
    .displayName("slack-java-client")
    .push(new SlackMessage("Text from my ").bold("Slack-Java-Client"));

// Using SlackAttachment
new Slack(webhookUrl)
    .sendToUser("slackbot")
    .displayName("slack-java-client")
    .push(new SlackAttachment("Text from my Slack-Java-Client").author("ashwanthkumar", "https://avatars0.githubusercontent.com/u/600279?v=3&s=40"));

Notes

With SlackMessage you can create rich text as specified in https://api.slack.com/docs/formatting. Example usage

new SlackMessage("Some text can be")
    .italic("Italic")
    .text(". :)")

Available methods on SlackMessage

  • text
  • link
  • bold
  • italic
  • code
  • preformatted
  • quote

With SlackAttachment you can create much more sophisticated rich text as specified in https://api.slack.com/docs/attachments. Example usage

new SlackAttachment()
    .author("ashwanthkumar")
    .author("ashwanthkumar", "https://avatars0.githubusercontent.com/u/600279?v=3&s=40")

Available methods on SlackAttachment

  • fallback
  • color
  • preText
  • author
  • title
  • text
  • imageUrl
  • addField

License

http://www.apache.org/licenses/LICENSE-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].