Light Dark

slack

Slack API bindings for Hot.

Installation

Add this to the deps in your hot.hot file:

"hot.dev/slack": "1.0.5"

Configuration

The slack.api.key context variable is required. Set it to your Slack Bot User OAuth Token via the Hot app.

Usage

Send a Message

::messaging ::slack::messaging

response ::messaging/chat-post-message(::messaging/ChatPostMessageRequest({
  channel: "C01ABCDEF",
  text: "Hello from Hot!"
}))

List Channels

::channels ::slack::channels

response ::channels/conversations-list(::channels/ConversationsListRequest({}))
for-each(response.channels, (ch) {
  println(ch.name)
})

Get User Info

::users ::slack::users

response ::users/users-info(::users/UsersInfoRequest({
  user: "U01ABCDEF"
}))
println(response.user.real_name)

Upload a File

::files ::slack::files

response ::files/files-upload(::files/FilesUploadRequest({
  channels: "C01ABCDEF",
  filename: "report.txt",
  content: "File contents here",
  title: "My Report"
}))

API Base URL

https://slack.com/api

Modules

ModuleDescription
::slack::messagingChat messages, reactions, pins, scheduled messages
::slack::channelsConversations (channels, DMs, groups)
::slack::usersUser info, lists, profiles
::slack::filesFile uploads, listing, sharing, deletion
::slack::appsBot info and app management
::slack::callsRTM connections
::slack::miscAuth, team info, emoji, views, dialogs, OAuth
::slack::apiLow-level authenticated HTTP client
::slack::coreShared configuration (BASE_URL)

Documentation

License

Apache-2.0 - see LICENSE