Copyright | (c) 2020 Tom McLaughlin |
---|---|
License | MIT |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This is a simple library for creating and updating Slack messages that contain progress bars. It can be used to display the progress of a long-running task in a Slack channel, for example as part of CI tooling.
See app/Main.hs in the repo for example code, or README.md on GitHub for an animated GIF.
Synopsis
- createProgressBar :: SlackConfig -> ChannelName -> ProgressBarInfo -> IO (Either Text ProgressBar)
- updateProgressBar :: SlackConfig -> ProgressBar -> ProgressBarInfo -> IO (Either Text ())
- data ProgressBarInfo = ProgressBarInfo {}
- data ProgressBarAttachment = ProgressBarAttachment {}
- data ProgressBar
- type ChannelName = Text
- newtype SlackConfig = SlackConfig {}
Documentation
createProgressBar :: SlackConfig -> ChannelName -> ProgressBarInfo -> IO (Either Text ProgressBar) Source #
Create a progress bar message on the given channel.
Returns a ProgressBar
which can be used to update the message by calling updateProgressBar
.
updateProgressBar :: SlackConfig -> ProgressBar -> ProgressBarInfo -> IO (Either Text ()) Source #
Update an existing progress bar.
data ProgressBarInfo Source #
The state of a progress bar message.
ProgressBarInfo | |
|
data ProgressBarAttachment Source #
A Slack attachment.
ProgressBarAttachment | |
|
Instances
ToJSON ProgressBarAttachment Source # | |
Defined in Web.Slack.ProgressBar toJSON :: ProgressBarAttachment -> Value # toEncoding :: ProgressBarAttachment -> Encoding # toJSONList :: [ProgressBarAttachment] -> Value # toEncodingList :: [ProgressBarAttachment] -> Encoding # |
data ProgressBar Source #
An opaque type representing an existing Slack message.
type ChannelName = Text Source #
newtype SlackConfig Source #
Configuration options needed to connect to the Slack API
SlackConfig | |
|
Instances
Show SlackConfig Source # | |
Defined in Web.Slack.ProgressBar showsPrec :: Int -> SlackConfig -> ShowS # show :: SlackConfig -> String # showList :: [SlackConfig] -> ShowS # |