slack

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2016 License: LGPL-3.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ResponseTypeEphemeral responseType = iota
	ResponseTypeInChannel
)
View Source
const SlackWebAPIEndpoint = "https://slack.com/api"

Variables

This section is empty.

Functions

func EscapeMessage

func EscapeMessage(s string) string

Types

type Attachment

type Attachment struct {
	AuthorName string
	Title      string
	TitleLink  string
	Text       string
	Markdown   bool
}

func (Attachment) MarshalJSON added in v1.1.1

func (a Attachment) MarshalJSON() ([]byte, error)

func (*Attachment) UnmarshalJSON added in v1.1.1

func (a *Attachment) UnmarshalJSON(data []byte) error

type Response

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

func NewEphemeralResponse

func NewEphemeralResponse(text string) *Response

func NewInChannelResponse

func NewInChannelResponse(text string) *Response

type User

type User struct {
	ID   string
	Name string
}

func (User) String

func (u User) String() string

type WebAPI added in v1.0.1

type WebAPI struct {
	BaseURL string
	// contains filtered or unexported fields
}

func NewWebAPI added in v1.0.1

func NewWebAPI(token string, httpClient *http.Client) *WebAPI

func (*WebAPI) Call added in v1.0.1

func (api *WebAPI) Call(method string, params url.Values) (response []byte, u *url.URL, err error)

func (*WebAPI) GetChannelTopic added in v1.0.1

func (api *WebAPI) GetChannelTopic(channelID string) (string, error)

func (*WebAPI) SetChannelTopic added in v1.0.1

func (api *WebAPI) SetChannelTopic(channelID, topic string) error

type WebAPIError added in v1.0.1

type WebAPIError struct {
	Method, URL, Response string
}

func (*WebAPIError) Error added in v1.0.1

func (e *WebAPIError) Error() string

Jump to

Keyboard shortcuts

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