slack

package
v0.0.0-...-aa4c984 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlwaysNotify

func AlwaysNotify(m *Message) bool

func NewBotClient

func NewBotClient(token, asUser, displayName, avatarURL string, c http.Client, messageFilter MessageFilter) *client

func NewClient

func NewClient(token string, c http.Client, messageFilter MessageFilter) *client

Types

type Client

type Client interface {
	SendText(channelID, text string) error
	SendImage(channelID, fallbackText, url string) error

	AccessToken() string
}

type Comment

type Comment struct {
	Comment string `json:"comment"`
	User    string `json:"user"`
}

type File

type File struct {
	MIMEType       string   `json:"mimetype"`
	URL            string   `json:"url"`
	OriginalHeight int      `json:"original_h"`
	OriginalWidth  int      `json:"original_w"`
	Size           int64    `json:"size"`
	CommentsCount  int      `json:"comments_count"`
	InitialComment *Comment `json:"initial_comment"`
}

type Hello

type Hello struct {
	Type string `json:"type"`
}

type Message

type Message struct {
	Type    string `json:"type"`
	Subtype string `json:"subtype"`
	Channel string `json:"channel"`
	TS      string `json:"ts"`
	User    string `json:"user"`
	Text    string `json:"text"`

	File *File `json:"file"`
}

func (*Message) Timestamp

func (m *Message) Timestamp() float64

type MessageFilter

type MessageFilter func(*Message) bool

type RoomMembers

type RoomMembers struct {
	Members map[string][]*User
	// contains filtered or unexported fields
}

func NewRoomMembers

func NewRoomMembers() *RoomMembers

func (*RoomMembers) Add

func (m *RoomMembers) Add(channel string, user *User)

func (*RoomMembers) Any

func (m *RoomMembers) Any(channel string) *User

type User

type User struct {
	UserID string
	Client Client
}

Jump to

Keyboard shortcuts

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