Documentation ¶
Index ¶
- Constants
- func GetSlackChannelName(input string) string
- func GetSlackUserName(input string) string
- func IsSlackChannelName(input string) bool
- func IsSlackUserName(input string) bool
- func Start(token string) (wsurl, id string, err error)
- type Client
- type Message
- type SlackChannel
- type SlackChannelsResult
- type SlackMembersResult
- type SlackUser
Constants ¶
View Source
const (
SlackOriginUrl = "https://api.slack.com/"
)
Variables ¶
This section is empty.
Functions ¶
func GetSlackChannelName ¶
func GetSlackUserName ¶
func IsSlackChannelName ¶
func IsSlackUserName ¶
Types ¶
type Client ¶
type Client struct { Id string // contains filtered or unexported fields }
Client defines a client for Slack API.
func (*Client) Connect ¶
Starts a websocket-based Real Time API session and return the websocket and the ID of the (bot-)user whom the token belongs to.
func (*Client) GetMessage ¶
func (*Client) GetTeamChannels ¶
func (c *Client) GetTeamChannels() ([]SlackChannel, error)
func (*Client) GetTeamUsers ¶
func (*Client) PostMessage ¶
type Message ¶
type Message struct { Id uint64 `json:"Id"` Type string `json:"type"` Channel string `json:"channel"` Text string `json:"text"` User string `json:"user"` }
These are the messages read off and written into the websocket. Since this struct serves as both read and write, we include the "Id" field which is required only for writing.
type SlackChannel ¶
type SlackChannelsResult ¶
type SlackChannelsResult struct { Ok bool `json:"ok"` Channels []SlackChannel `json:"channels"` }
type SlackMembersResult ¶
Click to show internal directories.
Click to hide internal directories.