Documentation ¶
Index ¶
- Constants
- Variables
- type Connection
- func (c *Connection) FindChannelNamesStartingWith(prefix string) ([]string, error)
- func (c *Connection) FindUserNamesStartingWith(prefix string) ([]string, error)
- func (c *Connection) GetAllChannels() ([]slack.Channel, error)
- func (c *Connection) GetConversationInfo(id string) (*slack.Channel, error)
- func (c *Connection) GetConversations(types ...string) ([]slack.Channel, error)
- func (c *Connection) GetConversationsCaching(types ...string) ([]slack.Channel, error)
- func (c *Connection) GetMessages(channelID string, count int) ([]slack.Message, error)
- func (c *Connection) GetUsers() ([]slack.User, error)
- func (c *Connection) MarkIMChannel(channelID string, ts string) error
- func (c *Connection) SendMessage(channelID, message string) error
- func (c *Connection) SetChannelReadMark(channelID string, ts string) error
- func (c *Connection) SetGroupReadMark(groupID string, ts string) error
- func (c *Connection) UserLookup(userID string) (*slack.User, error)
- func (c *Connection) UserLookupByName(name string) (*slack.User, error)
Constants ¶
View Source
const ( // TPublicChannel public channels TPublicChannel string = "public_channel" // TPrivateChannel private channels TPrivateChannel string = "private_channel" // TIm instant messages (privmsg) conversations TIm string = "im" // TMpim multi-point instant messages conversations TMpim string = "mpim" )
Variables ¶
View Source
var ( // TAll all channels TAll = []string{TIm, TMpim, TPrivateChannel, TPublicChannel} )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Name string User *slack.User Config *config.TeamConfig // contains filtered or unexported fields }
Connection active connection to a slack-team
func New ¶
func New(config *config.TeamConfig, oe func(source *Connection, event *slack.RTMEvent)) (*Connection, error)
New Create new team connection
func (*Connection) FindChannelNamesStartingWith ¶
func (c *Connection) FindChannelNamesStartingWith(prefix string) ([]string, error)
func (*Connection) FindUserNamesStartingWith ¶
func (c *Connection) FindUserNamesStartingWith(prefix string) ([]string, error)
func (*Connection) GetAllChannels ¶
func (c *Connection) GetAllChannels() ([]slack.Channel, error)
GetAllChannels return all team channels
func (*Connection) GetConversationInfo ¶
func (c *Connection) GetConversationInfo(id string) (*slack.Channel, error)
GetConversationInfo get channel information
func (*Connection) GetConversations ¶
func (c *Connection) GetConversations(types ...string) ([]slack.Channel, error)
GetConversations get conversations
func (*Connection) GetConversationsCaching ¶
func (c *Connection) GetConversationsCaching(types ...string) ([]slack.Channel, error)
func (*Connection) GetMessages ¶
GetMessages get channel messages
func (*Connection) GetUsers ¶
func (c *Connection) GetUsers() ([]slack.User, error)
GetUsers return all team users
func (*Connection) MarkIMChannel ¶
func (c *Connection) MarkIMChannel(channelID string, ts string) error
func (*Connection) SendMessage ¶
func (c *Connection) SendMessage(channelID, message string) error
SendMessage send message to a channel
func (*Connection) SetChannelReadMark ¶
func (c *Connection) SetChannelReadMark(channelID string, ts string) error
func (*Connection) SetGroupReadMark ¶
func (c *Connection) SetGroupReadMark(groupID string, ts string) error
func (*Connection) UserLookup ¶
func (c *Connection) UserLookup(userID string) (*slack.User, error)
UserLookup lookup a team user by the userID
func (*Connection) UserLookupByName ¶
func (c *Connection) UserLookupByName(name string) (*slack.User, error)
UserLookupByName look up team user by user-name
Click to show internal directories.
Click to hide internal directories.