![]() Fetch the channel history (since v0.5.0) (needs full user credentials).Open a multiparty direct message channel (since v0.5.0).Open a direct message channel (since v0.5.0).Post a message on a channel / private group / user. ![]() ndMessage(channel, "hi im a bot" ) Īll these commands can be sent through the library provided your bot has the rights to (IE : the bot has to be a member of the group or the channel to post some messages on it) SlackChannel channel = session.findChannelByName("general") //make sure bot is a member of the channel. Sample code SlackSession session = SlackSessionFactory.createWebSocketSlackSession("slack-bot-auth-token") You can find some samples of the most common use cases in the samples folder. Released versions are also availables on the maven central repository : You can add this library as a dependency to your Maven or Gradle project through JitPack. With this library you should be able to connect to Slack and to send some messages in less than 20 lines (no one-liners). The main purpose of this library is to build Slack bots able to react to channel events without having to configure any web hook. This library allows an application to connect to Slack to receive and send messages from any channel as if it were a slack client.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |