Documentation ¶
Index ¶
- type Attachment
- type BotProfile
- type Cache
- type Channel
- type ChannelInfoResponse
- type ConversationsResponse
- type Cursor
- type CursorResponseMetadata
- type File
- type HistoryResponse
- type Message
- type RTMClient
- type RTMConnectResponse
- type RTMEvent
- type SendMessage
- type SendMessageResponse
- type SlackClient
- func (c *SlackClient) API(verb, path string, params map[string]string, body []byte) ([]byte, error)
- func (c *SlackClient) ChannelIDForName(name string) (string, error)
- func (c *SlackClient) ChannelInfo(id string) (*Channel, error)
- func (c *SlackClient) ConnectToRTM() (*RTMClient, error)
- func (c *SlackClient) GetLocation() *time.Location
- func (c *SlackClient) History(channelID string, startTimestamp string, thread string, limit int) (*HistoryResponse, error)
- func (c *SlackClient) SendMessage(channelID string, message string) (*SendMessageResponse, error)
- func (c *SlackClient) UsernameForID(id string) (string, error)
- func (c *SlackClient) UsernameForMessage(message Message) (string, error)
- type User
- type UsersInfoResponse
- type UsersResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type BotProfile ¶
type ChannelInfoResponse ¶
type ConversationsResponse ¶
type ConversationsResponse struct { CursorResponseMetadata Ok bool Channels []Channel }
type CursorResponseMetadata ¶
type CursorResponseMetadata struct {
ResponseMetadata Cursor `json:"response_metadata"`
}
type HistoryResponse ¶
type HistoryResponse struct { CursorResponseMetadata Ok bool HasMore bool `json:"has_more"` Messages []Message }
type RTMClient ¶
type RTMClient struct {
// contains filtered or unexported fields
}
func (*RTMClient) ListenForMessagesFromBot ¶
ListenForMessagesFromBot listens for the first message from the bot in a given channel and prints its contents
type RTMConnectResponse ¶
type RTMEvent ¶
type RTMEvent struct { Type string `json:"type"` Channel string `json:"channel,omitempty"` User string `json:"user,omitempty"` Text string `json:"text,omitempty"` TS string `json:"ts,omitempty"` BotID string `json:"bot_id,omitempty"` BotProfile BotProfile `json:"bot_profile,omitempty"` Subtype string `json:"subtype,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` Files []File `json:"files,omitempty"` }
type SendMessage ¶
type SendMessage struct { ThreadTS string `json:"thread_ts,omitempty"` Channel string `json:"channel"` // required Text string `json:"text,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
type SendMessageResponse ¶
type SendMessageResponse struct { OK bool `json:"ok"` Error string `json:"error,omitempty"` Warning string `json:"warning,omitempty"` TS string `json:"ts,omitempty"` Message Message `json:"message,omitempty"` }
func (*SendMessageResponse) Output ¶
func (r *SendMessageResponse) Output(team, channelID string) string
type SlackClient ¶
type SlackClient struct {
// contains filtered or unexported fields
}
func Null ¶
func Null(team string, roundTripper http.RoundTripper) (*SlackClient, error)
Null produces a SlackClient suitable for testing that does not try to load the Slack token or cookies from disk, and starts with an empty cache.
func (*SlackClient) ChannelIDForName ¶
func (c *SlackClient) ChannelIDForName(name string) (string, error)
func (*SlackClient) ChannelInfo ¶
func (c *SlackClient) ChannelInfo(id string) (*Channel, error)
func (*SlackClient) ConnectToRTM ¶
func (c *SlackClient) ConnectToRTM() (*RTMClient, error)
func (*SlackClient) GetLocation ¶
func (c *SlackClient) GetLocation() *time.Location
func (*SlackClient) History ¶
func (c *SlackClient) History(channelID string, startTimestamp string, thread string, limit int) (*HistoryResponse, error)
func (*SlackClient) SendMessage ¶
func (c *SlackClient) SendMessage(channelID string, message string) (*SendMessageResponse, error)
func (*SlackClient) UsernameForID ¶
func (c *SlackClient) UsernameForID(id string) (string, error)
func (*SlackClient) UsernameForMessage ¶
func (c *SlackClient) UsernameForMessage(message Message) (string, error)
type UsersInfoResponse ¶
type UsersResponse ¶
type UsersResponse struct { CursorResponseMetadata Ok bool Members []User }
Click to show internal directories.
Click to hide internal directories.