Documentation ¶
Index ¶
- type RawSlackMessage
- type SlackConnection
- func (c *SlackConnection) AppendMessageHistory(message gateway.Message)
- func (c *SlackConnection) Channels() []gateway.Channel
- func (c *SlackConnection) ClearMessageHistory()
- func (c *SlackConnection) Connect() error
- func (c *SlackConnection) DeleteMessageHistory(index int)
- func (c *SlackConnection) Disconnect() error
- func (c *SlackConnection) FetchChannelMessages(channel gateway.Channel, startTs *string) ([]gateway.Message, error)
- func (c *SlackConnection) FetchChannels() ([]gateway.Channel, error)
- func (c *SlackConnection) Incoming() chan gateway.Event
- func (c *SlackConnection) JoinChannel(inChannel *gateway.Channel) (*gateway.Channel, error)
- func (c *SlackConnection) LeaveChannel(channel *gateway.Channel) (*gateway.Channel, error)
- func (c *SlackConnection) MessageHistory() []gateway.Message
- func (c *SlackConnection) Name() string
- func (c *SlackConnection) Outgoing() chan gateway.Event
- func (c *SlackConnection) ParseMessage(preMessage map[string]interface{}, cachedUsers map[string]*gateway.User) (*gateway.Message, error)
- func (c *SlackConnection) PostBinary(title string, filename string, content []byte) error
- func (c *SlackConnection) PostText(title string, content string) error
- func (c *SlackConnection) PrependMessageHistory(message gateway.Message)
- func (c *SlackConnection) Refresh(force bool) error
- func (c *SlackConnection) SelectedChannel() *gateway.Channel
- func (c *SlackConnection) Self() *gateway.User
- func (c *SlackConnection) SendMessage(message gateway.Message, channel *gateway.Channel) (*gateway.Message, error)
- func (c *SlackConnection) SetChannels(channels []gateway.Channel)
- func (c *SlackConnection) SetMessageHistory(messages []gateway.Message)
- func (c *SlackConnection) SetSelectedChannel(channel *gateway.Channel)
- func (c *SlackConnection) SetSelf(u gateway.User)
- func (c *SlackConnection) SetTeam(t gateway.Team)
- func (c *SlackConnection) SetUserOnline(user *gateway.User, status bool)
- func (c *SlackConnection) Status() gateway.ConnectionStatus
- func (c *SlackConnection) Team() *gateway.Team
- func (c *SlackConnection) ToggleMessageReaction(message gateway.Message, reaction string) error
- func (c *SlackConnection) TypingUsers() *gateway.TypingUsers
- func (c *SlackConnection) UserById(id string) (*gateway.User, error)
- func (c *SlackConnection) UserOnline(user *gateway.User) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RawSlackMessage ¶
type RawSlackMessage struct { Ts string `json:"ts"` UserId string `json:"user"` Text string `json:"text"` Reactions []struct { Name string `json:"name"` Users []string `json:"users"` } `json:"reactions"` File struct { Id string `json:"id"` Name string `json:"name"` Filetype string `json:"pretty_type"` User string `json:"user"` PrivateUrl string `json:"url_private"` Permalink string `json:"permalink"` Text string `json:"plain_text"` Reactions []struct { Name string `json:"name"` Users []string `json:"users"` } `json:"reactions"` } `json:"file,omitempty"` Attachments []struct { Title string `json:"title"` TitleLink string `json:"title_link"` Color string `json:"color"` Text string `json:"text"` Fields []struct { Title string `json:"title"` Value string `json:"value"` Short bool `json:"short"` } `json:"fields"` } `json:"attachments"` }
type SlackConnection ¶
type SlackConnection struct {
// contains filtered or unexported fields
}
SlackConnection meets the connection interface.
func New ¶
func New(token string) *SlackConnection
func NewWithName ¶
func NewWithName(nickname string, token string) *SlackConnection
func (*SlackConnection) AppendMessageHistory ¶
func (c *SlackConnection) AppendMessageHistory(message gateway.Message)
func (*SlackConnection) Channels ¶
func (c *SlackConnection) Channels() []gateway.Channel
func (*SlackConnection) ClearMessageHistory ¶
func (c *SlackConnection) ClearMessageHistory()
func (*SlackConnection) Connect ¶
func (c *SlackConnection) Connect() error
Connect to the slack persistent socket.
func (*SlackConnection) DeleteMessageHistory ¶
func (c *SlackConnection) DeleteMessageHistory(index int)
func (*SlackConnection) Disconnect ¶
func (c *SlackConnection) Disconnect() error
func (*SlackConnection) FetchChannelMessages ¶
func (c *SlackConnection) FetchChannelMessages(channel gateway.Channel, startTs *string) ([]gateway.Message, error)
Given a channel, return all messages within that channel.
func (*SlackConnection) FetchChannels ¶
func (c *SlackConnection) FetchChannels() ([]gateway.Channel, error)
Fetch all channels for the given team
func (*SlackConnection) Incoming ¶
func (c *SlackConnection) Incoming() chan gateway.Event
func (*SlackConnection) JoinChannel ¶
Join the passed channel.
func (*SlackConnection) LeaveChannel ¶
Leave the passed channel.
func (*SlackConnection) MessageHistory ¶
func (c *SlackConnection) MessageHistory() []gateway.Message
func (*SlackConnection) Outgoing ¶
func (c *SlackConnection) Outgoing() chan gateway.Event
func (*SlackConnection) ParseMessage ¶
func (*SlackConnection) PostBinary ¶
func (c *SlackConnection) PostBinary(title string, filename string, content []byte) error
func (*SlackConnection) PostText ¶
func (c *SlackConnection) PostText(title string, content string) error
func (*SlackConnection) PrependMessageHistory ¶
func (c *SlackConnection) PrependMessageHistory(message gateway.Message)
func (*SlackConnection) Refresh ¶
func (c *SlackConnection) Refresh(force bool) error
Called when the connection becomes active
func (*SlackConnection) SelectedChannel ¶
func (c *SlackConnection) SelectedChannel() *gateway.Channel
func (*SlackConnection) Self ¶
func (c *SlackConnection) Self() *gateway.User
func (*SlackConnection) SendMessage ¶
func (c *SlackConnection) SendMessage(message gateway.Message, channel *gateway.Channel) (*gateway.Message, error)
Send a given message to a given channel. Also, is able to process slash commands. Returns an optional pointer to a response message and an error.
func (*SlackConnection) SetChannels ¶
func (c *SlackConnection) SetChannels(channels []gateway.Channel)
func (*SlackConnection) SetMessageHistory ¶
func (c *SlackConnection) SetMessageHistory(messages []gateway.Message)
func (*SlackConnection) SetSelectedChannel ¶
func (c *SlackConnection) SetSelectedChannel(channel *gateway.Channel)
func (*SlackConnection) SetSelf ¶
func (c *SlackConnection) SetSelf(u gateway.User)
func (*SlackConnection) SetTeam ¶
func (c *SlackConnection) SetTeam(t gateway.Team)
func (*SlackConnection) SetUserOnline ¶
func (c *SlackConnection) SetUserOnline(user *gateway.User, status bool)
func (*SlackConnection) Status ¶
func (c *SlackConnection) Status() gateway.ConnectionStatus
func (*SlackConnection) Team ¶
func (c *SlackConnection) Team() *gateway.Team
func (*SlackConnection) ToggleMessageReaction ¶
func (c *SlackConnection) ToggleMessageReaction(message gateway.Message, reaction string) error
func (*SlackConnection) TypingUsers ¶
func (c *SlackConnection) TypingUsers() *gateway.TypingUsers
func (*SlackConnection) UserById ¶
func (c *SlackConnection) UserById(id string) (*gateway.User, error)
func (*SlackConnection) UserOnline ¶
func (c *SlackConnection) UserOnline(user *gateway.User) bool
Click to show internal directories.
Click to hide internal directories.