Versions in this module Expand all Collapse all v0 v0.0.1 Jul 26, 2015 Changes in this version + const DEFAULT_FILES_COUNT + const DEFAULT_FILES_PAGE + const DEFAULT_FILES_TS_FROM + const DEFAULT_FILES_TS_TO + const DEFAULT_FILES_TYPES + const DEFAULT_FILES_USERID + const DEFAULT_HISTORY_COUNT + const DEFAULT_HISTORY_INCLUSIVE + const DEFAULT_HISTORY_LATEST + const DEFAULT_HISTORY_OLDEST + const DEFAULT_MESSAGE_ASUSER + const DEFAULT_MESSAGE_ESCAPE_TEXT + const DEFAULT_MESSAGE_ICON_EMOJI + const DEFAULT_MESSAGE_ICON_URL + const DEFAULT_MESSAGE_LINK_NAMES + const DEFAULT_MESSAGE_MARKDOWN + const DEFAULT_MESSAGE_PARSE + const DEFAULT_MESSAGE_UNFURL_LINKS + const DEFAULT_MESSAGE_UNFURL_MEDIA + const DEFAULT_MESSAGE_USERNAME + const DEFAULT_REACTIONS_COUNT + const DEFAULT_REACTIONS_FULL + const DEFAULT_REACTIONS_PAGE + const DEFAULT_REACTIONS_USERID + const DEFAULT_SEARCH_COUNT + const DEFAULT_SEARCH_HIGHLIGHT + const DEFAULT_SEARCH_PAGE + const DEFAULT_SEARCH_SORT + const DEFAULT_SEARCH_SORT_DIR + const DEFAULT_STARS_COUNT + const DEFAULT_STARS_PAGE + const DEFAULT_STARS_USERID + const TYPE_CHANNEL + const TYPE_FILE + const TYPE_FILE_COMMENT + const TYPE_GROUP + const TYPE_IM + const TYPE_MESSAGE + var SLACK_API string = "https://slack.com/api/" + var SLACK_WEB_API_FORMAT string = "https://%s.slack.com/api/users.admin.%s?t=%s" + func GetOAuthToken(clientId, clientSecret, code, redirectURI string, debug bool) (accessToken string, scope string, err error) + type AccountsChangedEvent struct + Type string + type AckMessage struct + ReplyTo int + Text string + Timestamp string + type Attachment struct + AuthorIcon string + AuthorLink string + AuthorName string + Color string + Fallback string + Fields []AttachmentField + ImageURL string + MarkdownIn []string + Pretext string + Text string + ThumbURL string + Title string + TitleLink string + type AttachmentField struct + Short bool + Title string + Value string + type AuthTestResponse struct + Team string + TeamId string + Url string + User string + UserId string + type BaseChannel struct + Created JSONTime + Id string + IsOpen bool + LastRead string + Latest Message + UnreadCount int + UnreadCountDisplay int + type Bot struct + Deleted bool + Icons Icons + Id string + Name string + type BotAddedEvent struct + Bot Bot + Type string + type BotChangedEvent struct + Bot Bot + Type string + type Channel struct + Creator string + IsArchived bool + IsChannel bool + IsGeneral bool + IsMember bool + LastRead string + Latest *Message + Members []string + Name string + NumMembers int + Purpose ChannelPurpose + Topic ChannelTopic + UnreadCount int + type ChannelArchiveEvent ChannelInfoEvent + type ChannelCreatedEvent struct + Channel ChannelCreatedInfo + EventTimestamp JSONTimeString + Type string + type ChannelCreatedInfo struct + Created int + Creator string + Id string + IsChannel bool + Name string + type ChannelDeletedEvent ChannelInfoEvent + type ChannelHistoryChangedEvent struct + EventTimestamp JSONTimeString + Latest JSONTimeString + Timestamp JSONTimeString + Type string + type ChannelInfoEvent struct + ChannelId string + Timestamp *JSONTimeString + Type string + UserId string + type ChannelJoinedEvent struct + Channel Channel + Type string + type ChannelLeftEvent ChannelInfoEvent + type ChannelMarkedEvent ChannelInfoEvent + type ChannelPurpose struct + Creator string + LastSet JSONTime + Value string + type ChannelRenameEvent struct + Channel ChannelRenameInfo + Type string + type ChannelRenameInfo struct + Created JSONTimeString + Id string + Name string + type ChannelTopic struct + Creator string + LastSet JSONTime + Value string + type ChannelUnarchiveEvent ChannelInfoEvent + type CommandsChangedEvent struct + EventTimestamp JSONTimeString + Type string + type Comment struct + Comment string + Created JSONTime + Id string + Timestamp JSONTime + UserId string + type Config struct + type CtxChannel struct + Id string + Name string + type CtxMessage struct + Text string + Timestamp string + Type string + UserId string + Username string + type EmailDomainChangedEvent struct + EmailDomain string + EventTimestamp JSONTimeString + Type string + type EmojiChangedEvent struct + EventTimestamp JSONTimeString + Type string + type Event struct + Type string + type File struct + Channels []string + Created JSONTime + EditLink string + Editable bool + ExternalType string + Filetype string + Groups []string + Id string + InitialComment Comment + IsExternal bool + IsPublic bool + IsStarred bool + Lines int + LinesMore int + Mimetype string + Mode string + Name string + NumStars int + Permalink string + PrettyType string + Preview string + PreviewHighlight string + PublicURLShared bool + Size int + Thumb360 string + Thumb360Gif string + Thumb360H int + Thumb360W int + Thumb64 string + Thumb80 string + Timestamp JSONTime + Title string + URL string + URLDownload string + URLPrivate string + URLPrivateDownload string + UserId string + type FileChangeEvent fileActionEvent + type FileCommentAddedEvent struct + Comment Comment + type FileCommentDeletedEvent struct + CommentId string + type FileCommentEditedEvent struct + Comment Comment + type FileCreatedEvent fileActionEvent + type FileDeletedEvent fileActionEvent + type FilePrivateEvent fileActionEvent + type FilePublicEvent fileActionEvent + type FileSharedEvent fileActionEvent + type FileUnsharedEvent fileActionEvent + type FileUploadParameters struct + Channels []string + Content string + File string + Filename string + Filetype string + InitialComment string + Title string + type GetFilesParameters struct + Count int + Page int + TimestampFrom JSONTime + TimestampTo JSONTime + Types string + UserId string + func NewGetFilesParameters() GetFilesParameters + type GetReactionsParameters struct + Full bool + func NewGetReactionsParameters() GetReactionsParameters + type Group struct + Creator string + IsArchived bool + IsGroup bool + IsOpen bool + LastRead string + Latest *Message + Members []string + Name string + NumMembers int + Purpose ChannelPurpose + Topic ChannelTopic + UnreadCount int + UnreadCountDisplay int + type GroupArchiveEvent ChannelInfoEvent + type GroupCloseEvent ChannelInfoEvent + type GroupCreatedEvent struct + Channel ChannelCreatedInfo + Type string + UserId string + type GroupHistoryChangedEvent ChannelHistoryChangedEvent + type GroupJoinedEvent ChannelJoinedEvent + type GroupLeftEvent ChannelInfoEvent + type GroupMarkedEvent ChannelInfoEvent + type GroupOpenEvent ChannelInfoEvent + type GroupRenameEvent ChannelRenameEvent + type GroupUnarchiveEvent ChannelInfoEvent + type HelloEvent struct + type History struct + HasMore bool + Latest string + Messages []Message + type HistoryParameters struct + Count int + Inclusive bool + Latest string + Oldest string + func NewHistoryParameters() HistoryParameters + type IM struct + IsIM bool + IsUserDeleted bool + UserId string + type IMCloseEvent ChannelInfoEvent + type IMCreatedEvent struct + Channel ChannelCreatedInfo + Type string + UserId string + type IMHistoryChangedEvent ChannelHistoryChangedEvent + type IMMarkedEvent ChannelInfoEvent + type IMMarkedHistoryChanged ChannelInfoEvent + type IMOpenEvent ChannelInfoEvent + type Icons struct + Image48 string + type Info struct + Bots []Bot + Channels []Channel + Groups []Group + IMs []IM + Team *Team + Url string + User *UserDetails + Users []User + func (info Info) GetBotById(botId string) *Bot + func (info Info) GetChannelById(channelId string) *Channel + func (info Info) GetGroupById(groupId string) *Group + func (info Info) GetUserById(userId string) *User + type Item struct + Channel string + Comment *Comment + File *File + Message *Message + Timestamp string + Type string + func NewChannelItem(ch string) Item + func NewFileCommentItem(f *File, c *Comment) Item + func NewFileItem(f *File) Item + func NewGroupItem(ch string) Item + func NewIMItem(ch string) Item + func NewMessageItem(ch string, m *Message) Item + type ItemReaction struct + Count int + Name string + Users []string + type ItemRef struct + ChannelId string + CommentId string + FileId string + Timestamp string + func NewRefToComment(commentID string) ItemRef + func NewRefToFile(fileID string) ItemRef + func NewRefToMessage(channelID, timestamp string) ItemRef + type JSONTime int64 + func (t JSONTime) String() string + type JSONTimeString string + func (t JSONTimeString) String() string + type LatencyReport struct + Value time.Duration + type ListReactionsParameters struct + Count int + Full bool + Page int + UserId string + func NewListReactionsParameters() ListReactionsParameters + type ManualPresenceChangeEvent struct + Presence string + Type string + type Message struct + SubMessage *Msg + type MessageEvent Message + type Msg struct + Attachments []Attachment + BotId string + ChannelId string + DeletedTimestamp string + File *File + Hidden bool + Id string + IsStarred bool + ReplyTo int + SubType string + Team string + Text string + Timestamp string + Type string + Upload bool + UserId string + Username string + type OutgoingMessage struct + ChannelId string + Id int + Text string + Type string + type Pagination struct + First int + Last int + Page int + PageCount int + PerPage int + TotalCount int + type Paging struct + Count int + Page int + Pages int + Total int + type Ping struct + Id int + Type string + type Pong struct + ReplyTo int + Type string + type PostMessageParameters struct + AsUser bool + Attachments []Attachment + EscapeText bool + IconEmoji string + IconURL string + LinkNames int + Markdown bool + Parse string + Text string + UnfurlLinks bool + UnfurlMedia bool + Username string + func NewPostMessageParameters() PostMessageParameters + type PrefChangeEvent struct + Name string + Type string + Value json.RawMessage + type Presence struct + Presence string + UserId string + type PresenceChangeEvent struct + Presence string + Type string + UserId string + type ReactedItem struct + Reactions []ItemReaction + type ReactionAddedEvent reactionEvent + type ReactionRemovedEvent reactionEvent + type SearchFiles struct + Matches []File + Total int + type SearchMessage struct + Channel CtxChannel + Next CtxMessage + Next2 CtxMessage + Permalink string + Previous CtxMessage + Previous2 CtxMessage + Text string + Timestamp string + Type string + UserId string + Username string + type SearchMessages struct + Matches []SearchMessage + Total int + type SearchParameters struct + Count int + Highlight bool + Page int + Sort string + SortDirection string + func NewSearchParameters() SearchParameters + type Slack struct + func New(token string) *Slack + func (api *Slack) AddReaction(name string, item ItemRef) error + func (api *Slack) ArchiveChannel(channelId string) error + func (api *Slack) ArchiveGroup(groupId string) error + func (api *Slack) AuthTest() (response *AuthTestResponse, error error) + func (api *Slack) CloseGroup(groupId string) (bool, bool, error) + func (api *Slack) CloseIMChannel(channelId string) (bool, bool, error) + func (api *Slack) CreateChannel(channel string) (*Channel, error) + func (api *Slack) CreateChildGroup(groupId string) (*Group, error) + func (api *Slack) CreateGroup(group string) (*Group, error) + func (api *Slack) DeleteFile(fileId string) error + func (api *Slack) DeleteMessage(channelId, messageTimestamp string) (string, string, error) + func (api *Slack) GetChannelHistory(channelId string, params HistoryParameters) (*History, error) + func (api *Slack) GetChannelInfo(channelId string) (*Channel, error) + func (api *Slack) GetChannels(excludeArchived bool) ([]Channel, error) + func (api *Slack) GetEmoji() (map[string]string, error) + func (api *Slack) GetFileInfo(fileId string, count, page int) (*File, []Comment, *Paging, error) + func (api *Slack) GetFiles(params GetFilesParameters) ([]File, *Paging, error) + func (api *Slack) GetGroupHistory(groupId string, params HistoryParameters) (*History, error) + func (api *Slack) GetGroupInfo(groupId string) (*Group, error) + func (api *Slack) GetGroups(excludeArchived bool) ([]Group, error) + func (api *Slack) GetIMChannels() ([]IM, error) + func (api *Slack) GetIMHistory(channelId string, params HistoryParameters) (*History, error) + func (api *Slack) GetInfo() Info + func (api *Slack) GetReactions(item ItemRef, params GetReactionsParameters) ([]ItemReaction, error) + func (api *Slack) GetStarred(params StarsParameters) ([]StarredItem, *Paging, error) + func (api *Slack) GetUserInfo(userId string) (*User, error) + func (api *Slack) GetUserPresence(userId string) (*UserPresence, error) + func (api *Slack) GetUsers() ([]User, error) + func (api *Slack) InviteGuest(teamName string, channelID string, firstName string, lastName string, ...) error + func (api *Slack) InviteRestricted(teamName string, channelID string, firstName string, lastName string, ...) error + func (api *Slack) InviteUserToChannel(channelId, userId string) (*Channel, error) + func (api *Slack) InviteUserToGroup(groupId, userId string) (*Group, bool, error) + func (api *Slack) JoinChannel(channel string) (*Channel, error) + func (api *Slack) KickUserFromChannel(channelId, userId string) error + func (api *Slack) KickUserFromGroup(groupId, userId string) error + func (api *Slack) LeaveChannel(channelId string) (bool, error) + func (api *Slack) LeaveGroup(groupId string) error + func (api *Slack) ListReactions(params ListReactionsParameters) ([]ReactedItem, *Paging, error) + func (api *Slack) MarkIMChannel(channelId, ts string) (err error) + func (api *Slack) OpenGroup(groupId string) (bool, bool, error) + func (api *Slack) OpenIMChannel(userId string) (bool, bool, string, error) + func (api *Slack) PostMessage(channelId string, text string, params PostMessageParameters) (channel string, timestamp string, err error) + func (api *Slack) RemoveReaction(name string, item ItemRef) error + func (api *Slack) RenameChannel(channelId, name string) (*Channel, error) + func (api *Slack) RenameGroup(groupId, name string) (*Channel, error) + func (api *Slack) Search(query string, params SearchParameters) (*SearchMessages, *SearchFiles, error) + func (api *Slack) SearchFiles(query string, params SearchParameters) (*SearchFiles, error) + func (api *Slack) SearchMessages(query string, params SearchParameters) (*SearchMessages, error) + func (api *Slack) SetChannelPurpose(channelId, purpose string) (string, error) + func (api *Slack) SetChannelReadMark(channelId, ts string) error + func (api *Slack) SetChannelTopic(channelId, topic string) (string, error) + func (api *Slack) SetDebug(debug bool) + func (api *Slack) SetGroupPurpose(groupId, purpose string) (string, error) + func (api *Slack) SetGroupReadMark(groupId, ts string) error + func (api *Slack) SetGroupTopic(groupId, topic string) (string, error) + func (api *Slack) SetUserAsActive() error + func (api *Slack) SetUserPresence(presence string) error + func (api *Slack) StartRTM(protocol, origin string) (*SlackWS, error) + func (api *Slack) UnarchiveChannel(channelId string) error + func (api *Slack) UnarchiveGroup(groupId string) error + func (api *Slack) UpdateMessage(channelId, timestamp, text string) (string, string, string, error) + func (api *Slack) UploadFile(params FileUploadParameters) (file *File, err error) + type SlackEvent struct + Data interface{} + Type uint64 + type SlackResponse struct + Error string + Ok bool + type SlackWS struct + func (api *SlackWS) HandleIncomingEvents(ch chan SlackEvent) + func (api *SlackWS) Keepalive(interval time.Duration) + func (api *SlackWS) NewOutgoingMessage(text string, channel string) *OutgoingMessage + func (api *SlackWS) Ping() error + func (api *SlackWS) SendMessage(msg *OutgoingMessage) error + type SlackWSError struct + Code int + Msg string + func (s SlackWSError) Error() string + type SlackWSResponse struct + Error *SlackWSError + Ok bool + type StarAddedEvent starEvent + type StarRemovedEvent starEvent + type StarredItem struct + type StarsParameters struct + Count int + Page int + User string + func NewStarsParameters() StarsParameters + type Team struct + Domain string + Id string + Name string + type TeamDomainChangeEvent struct + Domain string + Type string + Url string + type TeamJoinEvent struct + Type string + User *User + type TeamMigrationStartedEvent struct + Type string + type TeamPrefChangeEvent struct + Name string + Type string + Value []string + type TeamRenameEvent struct + EventTimestamp *JSONTimeString + Name string + Type string + type User struct + Color string + Deleted bool + Has2FA bool + HasFiles bool + Id string + IsAdmin bool + IsBot bool + IsOwner bool + IsPrimaryOwner bool + IsRestricted bool + IsUltraRestricted bool + Name string + Presence string + Profile UserProfile + RealName string + TZ string + TZLabel string + TZOffset int + type UserChangeEvent struct + Type string + User User + type UserDetails struct + Created JSONTime + Id string + ManualPresence string + Name string + Prefs UserPrefs + type UserPrefs struct + type UserPresence struct + AutoAway bool + ConnectionCount int + LastActivity JSONTime + ManualAway bool + Online bool + Presence string + type UserProfile struct + Email string + FirstName string + Image192 string + Image24 string + Image32 string + Image48 string + Image72 string + ImageOriginal string + LastName string + Phone string + RealName string + RealNameNormalized string + Skype string + Title string + type UserTypingEvent struct + ChannelId string + Type string + UserId string