slack

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadBufferSize    = 4096
	ReadTimeout       = 1 * time.Minute
	WriteTimeout      = 1 * time.Minute
	HeartbeatInterval = 30 * time.Second
)

Functions

This section is empty.

Types

type AuthServer

type AuthServer struct {
	TeamID    string
	TokenChan chan *Token
	// contains filtered or unexported fields
}

func NewAuthServer

func NewAuthServer(clientId, secret string, scopes []string, redirectUrl string, teamId string) *AuthServer

func (*AuthServer) Shutdown

func (authServer *AuthServer) Shutdown(ctx context.Context) error

func (*AuthServer) Start

func (authServer *AuthServer) Start(addr string) error

type Connector

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

func NewConnector

func NewConnector(teamId, token string) *Connector

func (*Connector) Async

func (*Connector) Async() bool

func (*Connector) Attach

func (connector *Connector) Attach(event *bot.Event, fileName string, file io.Reader, title string) error

func (*Connector) Client added in v0.3.0

func (connector *Connector) Client() *slack.Client

func (*Connector) Connect

func (connector *Connector) Connect() error

func (*Connector) GetChannelInfo

func (connector *Connector) GetChannelInfo(channelId string) (*bot.ChannelInfo, error)
func (connector *Connector) GetPermalink(event *bot.Event) string

func (*Connector) Idle

func (connector *Connector) Idle() chan bool

func (*Connector) Listen

func (connector *Connector) Listen() error

func (*Connector) ReceivedEvent

func (connector *Connector) ReceivedEvent() chan *bot.Event

func (*Connector) Send

func (connector *Connector) Send(event *bot.Event, username string, text string) error

func (*Connector) SendPrivate

func (connector *Connector) SendPrivate(event *bot.Event, userId, text string) error

func (*Connector) SendWithConfirm

func (connector *Connector) SendWithConfirm(event *bot.Event, username, text string) (string, error)

func (*Connector) WithIndicate

func (connector *Connector) WithIndicate(channel string) context.CancelFunc

type Event

type Event struct {
	Type string
	Ts   string
	Raw  []byte
}

type Message

type Message struct {
	Type    string
	SubType string `json:"subtype"`
	Ts      string
	Channel string
	User    string
	Text    string
	// contains filtered or unexported fields
}

type Ping

type Ping struct {
	Id   int    `json:"id"`
	Type string `json:"type"`
	Time int    `json:"time"`
}

type ReactionAdded

type ReactionAdded struct {
	Type     string `json:"type"`
	User     string `json:"user"`
	Reaction string `json:"reaction"`
	ItemUser string `json:"item_user"`
	Item     struct {
		Type        string `json:"type"`
		Channel     string `json:"channel"`
		Ts          string `json:"ts"`
		File        string `json:"file"`
		FileComment string `json:"file_comment"`
	} `json:"item"`
	EventTs string `json:"event_ts"`
}

type Token

type Token struct {
	AccessToken    string    `json:"access_token"`
	RefreshToken   string    `json:"refresh_token,omitempty"`
	Expiry         time.Time `json:"expiry,omitempty"`
	BotUserID      string    `json:"bot_user_id,omitempty"`
	BotAccessToken string    `json:"bot_access_token,omitempty"`
}

type Typing

type Typing struct {
	Id      int    `json:"id"`
	Type    string `json:"type"`
	Channel string `json:"channel"`
}

type UserTyping

type UserTyping struct {
	Type    string
	Channel string
	User    string
}

Jump to

Keyboard shortcuts

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