connection

package
v0.0.0-...-e980239 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

func (c *Connection) GetMessages(channelID string, count int) ([]slack.Message, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL