Documentation ¶
Index ¶
- type AbstractEvent
- type Bot
- type Channel
- type Error
- type Event
- type EventType
- type Group
- type HelloHandler
- type HelloType
- type Im
- type LatestMessage
- type MessageHandler
- type MessageType
- type Purpose
- type ResponseMessage
- type SlackClient
- type SlackContext
- type SlackData
- type Team
- type TextMessageHandler
- type Topic
- type User
- type UserTypingType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractEvent ¶
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 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 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 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 MessageHandler ¶
type MessageHandler interface {
OnMessage(c *SlackContext, m *MessageType) error
}
type MessageType ¶
type ResponseMessage ¶
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 TextMessageHandler ¶
type TextMessageHandler func(m *MessageType) error
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 ¶
Click to show internal directories.
Click to hide internal directories.