slack_rtm

package module
v0.0.0-...-08b7db7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2015 License: MIT Imports: 5 Imported by: 0

README

slack-rtm-client

Slack Real Time Message API integration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractEvent

type AbstractEvent struct {
	Type    string `json="type"`
	SubType string `json="subtype"`
}

type Bot

type Bot struct {
	Id      string `json="id"`
	Name    string `json="name"`
	Deleted bool   `json="deleted"`
}

type Channel

type Channel struct {
	Id                 string        `json="id"`
	Name               string        `json="name"`
	Created            int           `json="created"`
	Creator            string        `json="creator"`
	IsArchived         bool          `json="is_archived"`
	IsGeneral          bool          `json="is_general"`
	HasPins            bool          `json="has_pins"`
	IsMember           bool          `json="is_member"`
	Latest             LatestMessage `json="latest"`
	MemberIds          []string      `json="members"`
	UnReadCount        int           `json="unread_count"`
	UnreadCountDisplay int           `json="unread_count_display"`
	Purpose            Purpose       `json="purpose"`
	Topic              Topic         `json="topic"`
}

type Error

type Error struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
}

type Event

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

type EventType

type EventType int
const (
	NoEvent EventType = iota
	HelloEvent
	MessageEvent
	TextMessageEvent
	UserTypingEvent
	ChannelMarkedEvent
	ChannelCreatedEvent
	ChannelJoinedEvent
	ChannelLeftEvent
	ChannelDeletedEvent
	ChannelRenameEvent
	ChannelArchiveEvent
	ChannelUnarchiveEvent
	ChannelHistoryChangedEvent
	ImCreatedEvent
	ImOpenEvent
	ImCloseEvent
	ImMarkedEvent
	ImHistoryChangedEvent
	GroupJoinedEvent
	GroupLeftEvent
	GroupOpenEvent
	GroupCloseEvent
	GroupArchiveEvent
	GroupUnarchiveEvent
	GroupRenameEvent
	GroupMarkedEvent
	GroupHistoryChangedEvent
	FileCreatedEvent
	FileSharedEvent
	FileUnsharedEvent
	FilePublicEvent
	FilePrivateEvent
	FileChangeEvent
	FileDeletedEvent
	FileCommentAddedEvent
	FileCommentEditedEvent
	FileCommentDeletedEvent
	PinAddedEvent
	PinRemovedEvent
	PresenceChangedEvent
	ManualPresenceChangeEvent
	PrefChangeEvent
	UserChangeEvent
	TeamJoinEvent
	StarAddedEvent
	StarRemovedEvent
	EmojiChangedEvent
	CommandsChangedEvent
	TeamPlanChangeEvent
	TeamPrefChangeEvent
	TeamRenameEvent
	TeamDomainChangeEvent
	EmailDomainChangedEvent
	BotAddedEvent
	BotChangedEvent
	AccountsChangedEvent
	TeamMigrationStartedEvent
)

type Group

type Group struct {
	Id                 string        `json="id"`
	Name               string        `json="name"`
	IsGroup            bool          `json="is_group"`
	Creator            string        `json="creator"`
	IsArchived         bool          `json="is_archived"`
	HasPins            bool          `json="has_pins"`
	IsOpen             bool          `json="is_open"`
	LastRead           string        `json="last_read"`
	Latest             LatestMessage `json="latest"`
	UnReadCount        int           `json="unread_count"`
	UnreadCountDisplay int           `json="unread_count_display"`
	MemberIds          []string      `json="members"`
	Purpose            Purpose       `json="purpose"`
	Topic              Topic         `json="topic"`
}

type HelloHandler

type HelloHandler interface {
	OnHello(c *SlackContext) error
}

type HelloType

type HelloType struct {
	Type string `json="type"`
}

type Im

type Im struct {
	Id                 string        `json="id"`
	IsIm               bool          `json="is_im"`
	User               string        `json="user"`
	LastRead           string        `json="last_read"`
	UnreadCount        int           `json="unread_count"`
	UnreadCountDisplay int           `json="unread_count_display"`
	IsOpen             bool          `json="is_open"`
	IsUserDeleted      bool          `json="is_user_deleted"`
	Latest             LatestMessage `json="latest"`
}

type LatestMessage

type LatestMessage struct {
	Type      string `json="type"`
	User      string `json="user"`
	Text      string `json="text"`
	TimeStamp string `json="ts"`
}

type MessageHandler

type MessageHandler interface {
	OnMessage(c *SlackContext, m *MessageType) error
}

type MessageType

type MessageType struct {
	Type    string `json="type"`
	SubType string `json="subtype"`
	Channel string `json="channel"`
	User    string `json="user"`
	Text    string `json="text"`
	Ts      string `json="ts"`
	Edited  struct {
		User string `json="user"`
		Ts   string `json="ts"`
	} `json="edited"`
}

type Purpose

type Purpose struct {
	Value   string `json="value"`
	Creator string `json="creator"`
}

type ResponseMessage

type ResponseMessage struct {
	Type    string `json:"type"`
	Text    string `json:"text"`
	Id      string `json:"id"`
	Channel string `json:"channel"`
}

type SlackClient

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

func New

func New(token string) (*SlackClient, error)

func (*SlackClient) AddListener

func (s *SlackClient) AddListener(eType EventType, v interface{})

func (*SlackClient) Run

func (s *SlackClient) Run(h ...HelloHandler) error

func (*SlackClient) WriteMessage

func (s *SlackClient) WriteMessage(v interface{}) error

type SlackContext

type SlackContext struct {
	Client *SlackClient
}

type SlackData

type SlackData struct {
	Ok    bool   `json="ok"`
	Error string `json="error"`
	Url   string `json="url"`
	Self  struct {
		ID   string `json="id"`
		Name string `json="name"`
	} `json="self"`
	Users    []User    `json="users"`
	Team     Team      `json="team"`
	Ims      []Im      `json="ims"`
	Groups   []Group   `json="groups"`
	Channels []Channel `json="channels"`
	Bots     []Bot     `json="bots"`
}

type Team

type Team struct {
	Id               string `json="id"`
	Name             string `json="name"`
	EmailDomain      string `json="email_domain"`
	Domain           string `json="domain"`
	OverStorageLimit bool   `json="over_storage_limit"`
	Plan             string `json="plan"`
}

type TextMessageHandler

type TextMessageHandler func(m *MessageType) error

type Topic

type Topic struct {
	Value   string `json="value"`
	Creator string `json="creator"`
}

type User

type User struct {
	Id                string `json="id"`
	Name              string `json="name"`
	Deleted           bool   `json="deleted"`
	Status            string `json="status"`
	Color             string `json="color"`
	RealName          string `json="real_name"`
	IsAdmin           bool   `json="is_admin"`
	IsOwner           bool   `json="is_owner"`
	IsPrimaryOwner    bool   `json="is_primary_owner"`
	IsRestricted      bool   `json="is_restricted"`
	IsUltraRestricted bool   `json="is_ultra_restricted"`
	IsBot             bool   `json="is_bot"`
	HasFiles          bool   `json="has_files"`
	Presence          string `json="presence"`
	TimeZone          string `json="tz"`
	TimeZoneLabel     string `json="tz_label"`
	TimeZoneOffset    string `json="tz_offset"`
	Profile           struct {
		Firstname          string `json="first_name"`
		Lastname           string `json="last_name"`
		RealName           string `json="real_name"`
		RealNameNormalized string `json="real_name_normalized"`
		Email              string `json="email"`
		Phone              string `json="phone"`
		Skype              string `json="skype"`
		Title              string `json="title"`
		Image24            string `json="image_24"`
		Image32            string `json="image_32"`
		Image48            string `json="image_48"`
		Image72            string `json="image_72"`
		Image192           string `json="image_192"`
		ImageOriginal      string `json="image_original"`
	} `json="profile"`
}

type UserTypingType

type UserTypingType struct {
	Type    string `json="type"`
	Channel string `json="channel"`
	User    string `json="user"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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