slack-0.1.0.0: Haskell API for interacting with Slack

Safe HaskellNone
LanguageHaskell2010

Network.Slack.Message

Synopsis

Documentation

data Message Source

A nicer version of MessageRaw, with the user id converted to a User

Instances

data MessageRaw Source

A message sent on a channel. Message can also mean things like user joined or a message was edited TODO: Make this into a sum type of different message types, instead of using Maybe

convertRawMessage :: MessageRaw -> Slack Message Source

Converts a MessageRaw into a Message

newtype TimeStamp Source

Fixed point number with 12 decimal places of precision

Constructors

TimeStamp 

Fields

utcTime :: UTCTime
 

timeStampToString :: TimeStamp -> String Source

Converts a TimeStamp to the timestamp format the Slack API expects

channelHistory :: Int -> Channel -> Slack [Message] Source

List of the past n messages in the given channel n must be no greater than 1000

channelHistoryBefore :: Int -> TimeStamp -> Channel -> Slack [Message] Source

Gets the n messages occuring before the given time

channelHistoryAll :: Channel -> Slack [Message] Source

Retrieves the entire channel history

channelHistoryRecent :: Int -> Channel -> Slack [Message] Source

Retrieves a list of the most recent messages within the last n seconds

messagesByUser :: User -> [Message] -> [Message] Source

Retrieves the messages by the given user

postMessage :: String -> String -> Channel -> Slack TimeStamp Source

Posts a message as the given user to the given channel. Returns the timestamp of the message, if successful