Documentation ¶
Index ¶
- Constants
- func RtmSend(ws *websocket.Conn, m Message) error
- func RtmStart(token string) (wsurl string, err error)
- func ValidateCommand(handler http.Handler, commands map[string]string) http.HandlerFunc
- type Attachment
- type Bot
- func (b Bot) ChannelsHistory(params url.Values) ([]Message, error)
- func (b Bot) ChannelsInfo(channelId string) ([]string, error)
- func (b Bot) ChannelsList() ([]Channel, error)
- func (b Bot) ChatPostMessage(data url.Values) (err error)
- func (b *Bot) Get(endpoint string, params url.Values) (*http.Response, error)
- func (b Bot) PostForm(endpoint string, data url.Values) (respJson map[string]interface{}, err error)
- func (b Bot) UsersGetPresence(user string) (presence string, err error)
- func (b Bot) UsersList(presence string) (present []string, err error)
- func (b *Bot) WithClient(c *http.Client) *Bot
- type Channel
- type ChannelsListResp
- type Credentials
- type Field
- type FileObject
- type Message
Constants ¶
View Source
const (
API_BASE = "https://slack.com/api/"
)
Variables ¶
This section is empty.
Functions ¶
func ValidateCommand ¶
Types ¶
type Attachment ¶
type Attachment struct { Fallback string `json:"fallback"` Color string `json:"color"` Pretext string `json:"pretext"` AuthorName string `json:"author_name"` Title string `json:"title"` TitleLink string `json:"title_link"` Text string `json:"text"` Fields []Field `json:"fields"` MrkdwnIn []string `json:"mrkdwn_in"` }
type Bot ¶
type Bot struct { Token string `json:"token"` UserId string `json:"user_id"` User string `json:"user"` Client *http.Client }
func (Bot) ChannelsList ¶
func (Bot) UsersGetPresence ¶
type ChannelsListResp ¶
type ChannelsListResp struct {
// contains filtered or unexported fields
}
type Credentials ¶
func LoadCredentials ¶
func LoadCredentials(filename string) (credentials Credentials, err error)
type FileObject ¶
type Message ¶
type Message struct { Type string `json:"type"` SubType string `json:"subtype"` Channel string `json:"channel"` User string `json:"user"` Text string `json:"text"` Ts string `json:"ts"` File FileObject `json:"file"` Attachments []Attachment `json:"attachments"` }
Click to show internal directories.
Click to hide internal directories.