slack

package
v0.0.0-...-91bdc37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitialReplyTimeout = 2 * time.Second
	MaxDelayedReplies   = 5
	DelayedReplyTimeout = 28 * time.Minute
)
View Source
const (
	ResponseTypeEphemeral = "ephemeral"
	ResponseTypeInChannel = "in_channel"
)

Variables

This section is empty.

Functions

func FormatURL

func FormatURL(url, display string) string

Types

type AppOAuthCode

type AppOAuthCode struct {
	Code         string `json:"code"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

func (AppOAuthCode) GetToken

func (c AppOAuthCode) GetToken() (*AppOAuthToken, error)

type AppOAuthToken

type AppOAuthToken struct {
	AccessToken string        `json:"access_token"`
	Scope       string        `json:"scope"`
	TeamName    string        `json:"team_name"`
	TeamID      string        `json:"team_id"`
	Bot         BotOAuthToken `json:"bot"`
}

type Attachment

type Attachment struct {
	Fallback string `json:"fallback,omitempty"`
	Text     string `json:"text,omitempty"`
}

type BotOAuthToken

type BotOAuthToken struct {
	UserID      string `json:"bot_user_id"`
	AccessToken string `json:"bot_access_token"`
}

type Channel

type Channel struct {
	Team Team
	ID   string
	Name string
}

type Command

type Command struct {
	Token       string
	Command     string
	Text        string
	ResponseURL string
	User        User
	Channel     Channel
	Team        Team
	Received    time.Time
}

func ParseCommand

func ParseCommand(values url.Values) (Command, error)

type Message

type Message struct {
	Text         string       `json:"text"`
	ResponseType string       `json:"response_type,omitempty"`
	Attachments  []Attachment `json:"attachments,omitempty"`
}

func (Message) RespondTo

func (msg Message) RespondTo(cmd Command) error

func (Message) WriteTo

func (msg Message) WriteTo(wr io.Writer) (int64, error)

type Team

type Team struct {
	ID     string
	Domain string
}

type User

type User struct {
	Team Team
	ID   string
	Name string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL