slack

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack provides io access to the Slack network.

func New

func New(cfg *transport.Config) (*Slack, error)

New returns a new instance of Slack. cfg.IgnoreUsers must be set with the bot name or ID otherwise it will potentially read it's own messages.

func (*Slack) Channels

func (s *Slack) Channels() ([]*transport.Channel, error)

Channels lists all the channels we have access to.

func (*Slack) GetConversation added in v0.0.2

func (s *Slack) GetConversation(userID string) (string, error)

GetConversation gets a private conversation for the given user ID.

func (*Slack) GetUser

func (s *Slack) GetUser(user string) (*transport.User, error)

GetUser returns the full user data for the provided name or ID.

func (*Slack) GetUsers added in v0.0.2

func (s *Slack) GetUsers() ([]*transport.User, error)

GetUsers returns a list of all known users.

func (*Slack) SendEvent

func (s *Slack) SendEvent(ev *transport.Event) error

SendEvent sends a new event to Slack.

func (*Slack) SendMessage

func (s *Slack) SendMessage(dest, msg string) error

SendMessage sends a message using the default format.

func (*Slack) TunnelEvents

func (s *Slack) TunnelEvents(ctx context.Context, evCh chan *transport.Event, errCh chan error)

TunnelEvents translates Slack events to transport.Events tunneling them into evCh. The session is terminated when ctx.Done returns.

Jump to

Keyboard shortcuts

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