linklater-4.0.0.2: A Haskell library for the Slack API

Safe HaskellNone
LanguageHaskell2010

Network.Linklater.Types

Synopsis

Documentation

type ChannelID = Text Source #

The unique 'C<number>' Slack assigns to each channel. Used to say things.

newtype User Source #

A username: no at-signs, just text!

Constructors

User Text 

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Ord User Source # 

Methods

compare :: User -> User -> Ordering #

(<) :: User -> User -> Bool #

(<=) :: User -> User -> Bool #

(>) :: User -> User -> Bool #

(>=) :: User -> User -> Bool #

max :: User -> User -> User #

min :: User -> User -> User #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

data Command Source #

Incoming HTTP requests to the slash function get parsed into one of these babies.

Constructors

Command 

Fields

newtype Icon Source #

The icon next to the messages you say. (Images unsupported right now, sorry.)

Constructors

EmojiIcon Text

For example, ":stars2:".

Instances

Eq Icon Source # 

Methods

(==) :: Icon -> Icon -> Bool #

(/=) :: Icon -> Icon -> Bool #

Ord Icon Source # 

Methods

compare :: Icon -> Icon -> Ordering #

(<) :: Icon -> Icon -> Bool #

(<=) :: Icon -> Icon -> Bool #

(>) :: Icon -> Icon -> Bool #

(>=) :: Icon -> Icon -> Bool #

max :: Icon -> Icon -> Icon #

min :: Icon -> Icon -> Icon #

Show Icon Source # 

Methods

showsPrec :: Int -> Icon -> ShowS #

show :: Icon -> String #

showList :: [Icon] -> ShowS #

data Format Source #

A little DSL for Slack formatting.

Constructors

FormatAt !User
"<@user|user>"
FormatUser !User !Text
"<@user|user did this and that>"
FormatLink !Text !Text
"<http://example.com|user did this and that>"
FormatString !Text
"user did this &amp; that"

data Message Source #

Here's how you talk: you make one of these and pass it to say. Before the day is done, Linklater will convert this to a JSON blob using Aeson.

  • Simple messages are parsed by Slack with parse=full (i.e. as if you had typed it into the input box).
  • Complex messages are parsed according to Slack formatting. See Format.

data Config Source #

Like a curiosity about the world, you'll need one of these to say something.

Constructors

Config 

Fields

data RequestError Source #

Rather than throwing unchecked exceptions from our HTTP requests, we catch all unchecked exceptions and convert them to checked RequestError values.

Constructors

RequestError 

Fields

asList :: [a] -> [a] Source #