Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyMsgOptions(token, channel string, options ...MsgOption) (string, url.Values, error)
- func GetOAuthToken(clientID, clientSecret, code, redirectURI string, debug bool) (accessToken string, scope string, err error)
- func GetOAuthTokenContext(ctx context.Context, clientID, clientSecret, code, redirectURI string, ...) (accessToken string, scope string, err error)
- func SetHTTPClient(client HTTPRequester)
- func SetLogger(l *log.Logger)
- type AccessLogParameters
- type AccountsChangedEvent
- type AckErrorEvent
- type AckMessage
- type Attachment
- type AttachmentAction
- type AttachmentActionCallback
- type AttachmentActionOption
- type AttachmentActionOptionGroup
- type AttachmentField
- type AuthTestResponse
- type BillableInfoResponse
- type BillingActive
- type Bot
- type BotAddedEvent
- type BotChangedEvent
- type Channel
- type ChannelArchiveEvent
- type ChannelCreatedEvent
- type ChannelCreatedInfo
- type ChannelDeletedEvent
- type ChannelHistoryChangedEvent
- type ChannelInfoEvent
- type ChannelJoinedEvent
- type ChannelLeftEvent
- type ChannelMarkedEvent
- type ChannelRenameEvent
- type ChannelRenameInfo
- type ChannelUnarchiveEvent
- type Client
- func (api *Client) AddPin(channel string, item ItemRef) error
- func (api *Client) AddPinContext(ctx context.Context, channel string, item ItemRef) error
- func (api *Client) AddReaction(name string, item ItemRef) error
- func (api *Client) AddReactionContext(ctx context.Context, name string, item ItemRef) error
- func (api *Client) AddStar(channel string, item ItemRef) error
- func (api *Client) AddStarContext(ctx context.Context, channel string, item ItemRef) error
- func (api *Client) ArchiveChannel(channel string) error
- func (api *Client) ArchiveChannelContext(ctx context.Context, channel string) error
- func (api *Client) ArchiveGroup(group string) error
- func (api *Client) ArchiveGroupContext(ctx context.Context, group string) error
- func (api *Client) AuthTest() (response *AuthTestResponse, error error)
- func (api *Client) AuthTestContext(ctx context.Context) (response *AuthTestResponse, error error)
- func (api *Client) CloseGroup(group string) (bool, bool, error)
- func (api *Client) CloseGroupContext(ctx context.Context, group string) (bool, bool, error)
- func (api *Client) CloseIMChannel(channel string) (bool, bool, error)
- func (api *Client) CloseIMChannelContext(ctx context.Context, channel string) (bool, bool, error)
- func (api *Client) ConnectRTM() (info *Info, websocketURL string, err error)
- func (api *Client) ConnectRTMContext(ctx context.Context) (info *Info, websocketURL string, err error)
- func (api *Client) CreateChannel(channel string) (*Channel, error)
- func (api *Client) CreateChannelContext(ctx context.Context, channel string) (*Channel, error)
- func (api *Client) CreateChildGroup(group string) (*Group, error)
- func (api *Client) CreateChildGroupContext(ctx context.Context, group string) (*Group, error)
- func (api *Client) CreateGroup(group string) (*Group, error)
- func (api *Client) CreateGroupContext(ctx context.Context, group string) (*Group, error)
- func (api *Client) CreateUserGroup(userGroup UserGroup) (UserGroup, error)
- func (api *Client) CreateUserGroupContext(ctx context.Context, userGroup UserGroup) (UserGroup, error)
- func (api *Client) Debugf(format string, v ...interface{})
- func (api *Client) Debugln(v ...interface{})
- func (api *Client) DeleteFile(fileID string) error
- func (api *Client) DeleteFileContext(ctx context.Context, fileID string) error
- func (api *Client) DeleteMessage(channel, messageTimestamp string) (string, string, error)
- func (api *Client) DeleteMessageContext(ctx context.Context, channel, messageTimestamp string) (string, string, error)
- func (api *Client) DeleteUserPhoto() error
- func (api *Client) DeleteUserPhotoContext(ctx context.Context) error
- func (api *Client) DisableUser(teamName string, uid string) error
- func (api *Client) DisableUserContext(ctx context.Context, teamName string, uid string) error
- func (api *Client) DisableUserGroup(userGroup string) (UserGroup, error)
- func (api *Client) DisableUserGroupContext(ctx context.Context, userGroup string) (UserGroup, error)
- func (api *Client) EnableUserGroup(userGroup string) (UserGroup, error)
- func (api *Client) EnableUserGroupContext(ctx context.Context, userGroup string) (UserGroup, error)
- func (api *Client) EndDND() error
- func (api *Client) EndDNDContext(ctx context.Context) error
- func (api *Client) EndSnooze() (*DNDStatus, error)
- func (api *Client) EndSnoozeContext(ctx context.Context) (*DNDStatus, error)
- func (api *Client) GetAccessLogs(params AccessLogParameters) ([]Login, *Paging, error)
- func (api *Client) GetAccessLogsContext(ctx context.Context, params AccessLogParameters) ([]Login, *Paging, error)
- func (api *Client) GetBillableInfo(user string) (map[string]BillingActive, error)
- func (api *Client) GetBillableInfoContext(ctx context.Context, user string) (map[string]BillingActive, error)
- func (api *Client) GetBillableInfoForTeam() (map[string]BillingActive, error)
- func (api *Client) GetBillableInfoForTeamContext(ctx context.Context) (map[string]BillingActive, error)
- func (api *Client) GetBotInfo(bot string) (*Bot, error)
- func (api *Client) GetBotInfoContext(ctx context.Context, bot string) (*Bot, error)
- func (api *Client) GetChannelHistory(channel string, params HistoryParameters) (*History, error)
- func (api *Client) GetChannelHistoryContext(ctx context.Context, channel string, params HistoryParameters) (*History, error)
- func (api *Client) GetChannelInfo(channel string) (*Channel, error)
- func (api *Client) GetChannelInfoContext(ctx context.Context, channel string) (*Channel, error)
- func (api *Client) GetChannelReplies(channel, thread_ts string) ([]Message, error)
- func (api *Client) GetChannelRepliesContext(ctx context.Context, channel, thread_ts string) ([]Message, error)
- func (api *Client) GetChannels(excludeArchived bool) ([]Channel, error)
- func (api *Client) GetChannelsContext(ctx context.Context, excludeArchived bool) ([]Channel, error)
- func (api *Client) GetDNDInfo(user *string) (*DNDStatus, error)
- func (api *Client) GetDNDInfoContext(ctx context.Context, user *string) (*DNDStatus, error)
- func (api *Client) GetDNDTeamInfo(users []string) (map[string]DNDStatus, error)
- func (api *Client) GetDNDTeamInfoContext(ctx context.Context, users []string) (map[string]DNDStatus, error)
- func (api *Client) GetEmoji() (map[string]string, error)
- func (api *Client) GetEmojiContext(ctx context.Context) (map[string]string, error)
- func (api *Client) GetFileInfo(fileID string, count, page int) (*File, []Comment, *Paging, error)
- func (api *Client) GetFileInfoContext(ctx context.Context, fileID string, count, page int) (*File, []Comment, *Paging, error)
- func (api *Client) GetFiles(params GetFilesParameters) ([]File, *Paging, error)
- func (api *Client) GetFilesContext(ctx context.Context, params GetFilesParameters) ([]File, *Paging, error)
- func (api *Client) GetGroupHistory(group string, params HistoryParameters) (*History, error)
- func (api *Client) GetGroupHistoryContext(ctx context.Context, group string, params HistoryParameters) (*History, error)
- func (api *Client) GetGroupInfo(group string) (*Group, error)
- func (api *Client) GetGroupInfoContext(ctx context.Context, group string) (*Group, error)
- func (api *Client) GetGroups(excludeArchived bool) ([]Group, error)
- func (api *Client) GetGroupsContext(ctx context.Context, excludeArchived bool) ([]Group, error)
- func (api *Client) GetIMChannels() ([]IM, error)
- func (api *Client) GetIMChannelsContext(ctx context.Context) ([]IM, error)
- func (api *Client) GetIMHistory(channel string, params HistoryParameters) (*History, error)
- func (api *Client) GetIMHistoryContext(ctx context.Context, channel string, params HistoryParameters) (*History, error)
- func (api *Client) GetReactions(item ItemRef, params GetReactionsParameters) ([]ItemReaction, error)
- func (api *Client) GetReactionsContext(ctx context.Context, item ItemRef, params GetReactionsParameters) ([]ItemReaction, error)
- func (api *Client) GetStarred(params StarsParameters) ([]StarredItem, *Paging, error)
- func (api *Client) GetStarredContext(ctx context.Context, params StarsParameters) ([]StarredItem, *Paging, error)
- func (api *Client) GetTeamInfo() (*TeamInfo, error)
- func (api *Client) GetTeamInfoContext(ctx context.Context) (*TeamInfo, error)
- func (api *Client) GetUserGroupMembers(userGroup string) ([]string, error)
- func (api *Client) GetUserGroupMembersContext(ctx context.Context, userGroup string) ([]string, error)
- func (api *Client) GetUserGroups() ([]UserGroup, error)
- func (api *Client) GetUserGroupsContext(ctx context.Context) ([]UserGroup, error)
- func (api *Client) GetUserIdentity() (*UserIdentityResponse, error)
- func (api *Client) GetUserIdentityContext(ctx context.Context) (*UserIdentityResponse, error)
- func (api *Client) GetUserInfo(user string) (*User, error)
- func (api *Client) GetUserInfoContext(ctx context.Context, user string) (*User, error)
- func (api *Client) GetUserPresence(user string) (*UserPresence, error)
- func (api *Client) GetUserPresenceContext(ctx context.Context, user string) (*UserPresence, error)
- func (api *Client) GetUsers() ([]User, error)
- func (api *Client) GetUsersContext(ctx context.Context) ([]User, error)
- func (api *Client) InviteGuest(teamName, channel, firstName, lastName, emailAddress string) error
- func (api *Client) InviteGuestContext(ctx context.Context, ...) error
- func (api *Client) InviteRestricted(teamName, channel, firstName, lastName, emailAddress string) error
- func (api *Client) InviteRestrictedContext(ctx context.Context, ...) error
- func (api *Client) InviteToTeam(teamName, firstName, lastName, emailAddress string) error
- func (api *Client) InviteToTeamContext(ctx context.Context, teamName, firstName, lastName, emailAddress string) error
- func (api *Client) InviteUserToChannel(channel, user string) (*Channel, error)
- func (api *Client) InviteUserToChannelContext(ctx context.Context, channel, user string) (*Channel, error)
- func (api *Client) InviteUserToGroup(group, user string) (*Group, bool, error)
- func (api *Client) InviteUserToGroupContext(ctx context.Context, group, user string) (*Group, bool, error)
- func (api *Client) JoinChannel(channel string) (*Channel, error)
- func (api *Client) JoinChannelContext(ctx context.Context, channel string) (*Channel, error)
- func (api *Client) KickUserFromChannel(channel, user string) error
- func (api *Client) KickUserFromChannelContext(ctx context.Context, channel, user string) error
- func (api *Client) KickUserFromGroup(group, user string) error
- func (api *Client) KickUserFromGroupContext(ctx context.Context, group, user string) error
- func (api *Client) LeaveChannel(channel string) (bool, error)
- func (api *Client) LeaveChannelContext(ctx context.Context, channel string) (bool, error)
- func (api *Client) LeaveGroup(group string) error
- func (api *Client) LeaveGroupContext(ctx context.Context, group string) error
- func (api *Client) ListPins(channel string) ([]Item, *Paging, error)
- func (api *Client) ListPinsContext(ctx context.Context, channel string) ([]Item, *Paging, error)
- func (api *Client) ListReactions(params ListReactionsParameters) ([]ReactedItem, *Paging, error)
- func (api *Client) ListReactionsContext(ctx context.Context, params ListReactionsParameters) ([]ReactedItem, *Paging, error)
- func (api *Client) ListStars(params StarsParameters) ([]Item, *Paging, error)
- func (api *Client) ListStarsContext(ctx context.Context, params StarsParameters) ([]Item, *Paging, error)
- func (api *Client) MarkIMChannel(channel, ts string) (err error)
- func (api *Client) MarkIMChannelContext(ctx context.Context, channel, ts string) (err error)
- func (api *Client) NewRTM() *RTM
- func (api *Client) NewRTMWithOptions(options *RTMOptions) *RTM
- func (api *Client) OpenGroup(group string) (bool, bool, error)
- func (api *Client) OpenGroupContext(ctx context.Context, group string) (bool, bool, error)
- func (api *Client) OpenIMChannel(user string) (bool, bool, string, error)
- func (api *Client) OpenIMChannelContext(ctx context.Context, user string) (bool, bool, string, error)
- func (api *Client) PostDialog(triggerID string, token string, dialog Dialog) error
- func (api *Client) PostMessage(channel, text string, params PostMessageParameters) (string, string, error)
- func (api *Client) PostMessageContext(ctx context.Context, channel, text string, params PostMessageParameters) (string, string, error)
- func (api *Client) PostResponse(responseUrl string, params ResponseMessageParameters) error
- func (api *Client) RemovePin(channel string, item ItemRef) error
- func (api *Client) RemovePinContext(ctx context.Context, channel string, item ItemRef) error
- func (api *Client) RemoveReaction(name string, item ItemRef) error
- func (api *Client) RemoveReactionContext(ctx context.Context, name string, item ItemRef) error
- func (api *Client) RemoveStar(channel string, item ItemRef) error
- func (api *Client) RemoveStarContext(ctx context.Context, channel string, item ItemRef) error
- func (api *Client) RenameChannel(channel, name string) (*Channel, error)
- func (api *Client) RenameChannelContext(ctx context.Context, channel, name string) (*Channel, error)
- func (api *Client) RenameGroup(group, name string) (*Channel, error)
- func (api *Client) RenameGroupContext(ctx context.Context, group, name string) (*Channel, error)
- func (api *Client) RevokeFilePublicURL(fileID string) (*File, error)
- func (api *Client) RevokeFilePublicURLContext(ctx context.Context, fileID string) (*File, error)
- func (api *Client) Search(query string, params SearchParameters) (*SearchMessages, *SearchFiles, error)
- func (api *Client) SearchContext(ctx context.Context, query string, params SearchParameters) (*SearchMessages, *SearchFiles, error)
- func (api *Client) SearchFiles(query string, params SearchParameters) (*SearchFiles, error)
- func (api *Client) SearchFilesContext(ctx context.Context, query string, params SearchParameters) (*SearchFiles, error)
- func (api *Client) SearchMessages(query string, params SearchParameters) (*SearchMessages, error)
- func (api *Client) SearchMessagesContext(ctx context.Context, query string, params SearchParameters) (*SearchMessages, error)
- func (api *Client) SendMessage(channel string, options ...MsgOption) (string, string, string, error)
- func (api *Client) SendMessageContext(ctx context.Context, channel string, options ...MsgOption) (string, string, string, error)
- func (api *Client) SendSSOBindingEmail(teamName, user string) error
- func (api *Client) SendSSOBindingEmailContext(ctx context.Context, teamName, user string) error
- func (api *Client) SetChannelPurpose(channel, purpose string) (string, error)
- func (api *Client) SetChannelPurposeContext(ctx context.Context, channel, purpose string) (string, error)
- func (api *Client) SetChannelReadMark(channel, ts string) error
- func (api *Client) SetChannelReadMarkContext(ctx context.Context, channel, ts string) error
- func (api *Client) SetChannelTopic(channel, topic string) (string, error)
- func (api *Client) SetChannelTopicContext(ctx context.Context, channel, topic string) (string, error)
- func (api *Client) SetDebug(debug bool)
- func (api *Client) SetGroupPurpose(group, purpose string) (string, error)
- func (api *Client) SetGroupPurposeContext(ctx context.Context, group, purpose string) (string, error)
- func (api *Client) SetGroupReadMark(group, ts string) error
- func (api *Client) SetGroupReadMarkContext(ctx context.Context, group, ts string) error
- func (api *Client) SetGroupTopic(group, topic string) (string, error)
- func (api *Client) SetGroupTopicContext(ctx context.Context, group, topic string) (string, error)
- func (api *Client) SetRegular(teamName, user string) error
- func (api *Client) SetRegularContext(ctx context.Context, teamName, user string) error
- func (api *Client) SetRestricted(teamName, uid string) error
- func (api *Client) SetRestrictedContext(ctx context.Context, teamName, uid string) error
- func (api *Client) SetSnooze(minutes int) (*DNDStatus, error)
- func (api *Client) SetSnoozeContext(ctx context.Context, minutes int) (*DNDStatus, error)
- func (api *Client) SetUltraRestricted(teamName, uid, channel string) error
- func (api *Client) SetUltraRestrictedContext(ctx context.Context, teamName, uid, channel string) error
- func (api *Client) SetUserAsActive() error
- func (api *Client) SetUserAsActiveContext(ctx context.Context) error
- func (api *Client) SetUserCustomStatus(statusText, statusEmoji string) error
- func (api *Client) SetUserCustomStatusContext(ctx context.Context, statusText, statusEmoji string) error
- func (api *Client) SetUserPhoto(ctx context.Context, image string, params UserSetPhotoParams) error
- func (api *Client) SetUserPhotoContext(ctx context.Context, image string, params UserSetPhotoParams) error
- func (api *Client) SetUserPresence(presence string) error
- func (api *Client) SetUserPresenceContext(ctx context.Context, presence string) error
- func (api *Client) ShareFilePublicURL(fileID string) (*File, []Comment, *Paging, error)
- func (api *Client) ShareFilePublicURLContext(ctx context.Context, fileID string) (*File, []Comment, *Paging, error)
- func (api *Client) StartRTM() (info *Info, websocketURL string, err error)
- func (api *Client) StartRTMContext(ctx context.Context) (info *Info, websocketURL string, err error)
- func (api *Client) UnarchiveChannel(channel string) error
- func (api *Client) UnarchiveChannelContext(ctx context.Context, channel string) error
- func (api *Client) UnarchiveGroup(group string) error
- func (api *Client) UnarchiveGroupContext(ctx context.Context, group string) error
- func (api *Client) Unfurl(ctx context.Context, channel string, params UnfurlParameters) error
- func (api *Client) UnsetUserCustomStatus() error
- func (api *Client) UnsetUserCustomStatusContext(ctx context.Context) error
- func (api *Client) UpdateMessage(channel, timestamp, text string) (string, string, string, error)
- func (api *Client) UpdateMessageContext(ctx context.Context, channel, timestamp, text string) (string, string, string, error)
- func (api *Client) UpdateMessageWithAttachments(ctx context.Context, channel string, params UpdateMessageParameters) (string, string, string, error)
- func (api *Client) UpdateUserGroup(userGroup UserGroup) (UserGroup, error)
- func (api *Client) UpdateUserGroupContext(ctx context.Context, userGroup UserGroup) (UserGroup, error)
- func (api *Client) UpdateUserGroupMembers(userGroup string, members string) (UserGroup, error)
- func (api *Client) UpdateUserGroupMembersContext(ctx context.Context, userGroup string, members string) (UserGroup, error)
- func (api *Client) UploadFile(params FileUploadParameters) (file *File, err error)
- func (api *Client) UploadFileContext(ctx context.Context, params FileUploadParameters) (file *File, err error)
- type CommandsChangedEvent
- type Comment
- type ConfirmationField
- type ConnectedEvent
- type ConnectingEvent
- type ConnectionErrorEvent
- type CtxChannel
- type CtxMessage
- type DNDStatus
- type DNDUpdatedEvent
- type Dialog
- type DialogElement
- type DialogOption
- type DialogOptionGroup
- type DialogPost
- type DisconnectedEvent
- type Edited
- type EmailDomainChangedEvent
- type EmojiChangedEvent
- type Event
- type File
- type FileChangeEvent
- type FileCommentAddedEvent
- type FileCommentDeletedEvent
- type FileCommentEditedEvent
- type FileCreatedEvent
- type FileDeletedEvent
- type FilePrivateEvent
- type FilePublicEvent
- type FileSharedEvent
- type FileUnsharedEvent
- type FileUploadParameters
- type GetFilesParameters
- type GetReactionsParameters
- type Group
- type GroupArchiveEvent
- type GroupCloseEvent
- type GroupCreatedEvent
- type GroupHistoryChangedEvent
- type GroupJoinedEvent
- type GroupLeftEvent
- type GroupMarkedEvent
- type GroupOpenEvent
- type GroupRenameEvent
- type GroupRenameInfo
- type GroupUnarchiveEvent
- type HTTPRequester
- type HelloEvent
- type History
- type HistoryParameters
- type IDGenerator
- type IM
- type IMCloseEvent
- type IMCreatedEvent
- type IMHistoryChangedEvent
- type IMMarkedEvent
- type IMMarkedHistoryChanged
- type IMOpenEvent
- type Icon
- type Icons
- type IncomingEventError
- type Info
- type InvalidAuthEvent
- type Item
- type ItemReaction
- type ItemRef
- type JSONTime
- type LatencyReport
- type ListReactionsParameters
- type Login
- type LoginResponse
- type ManualPresenceChangeEvent
- type Message
- type MessageEvent
- type MessageTooLongEvent
- type Msg
- type MsgOption
- func MsgOptionAsUser(b bool) MsgOption
- func MsgOptionAttachments(attachments ...Attachment) MsgOption
- func MsgOptionDelete(timestamp string) MsgOption
- func MsgOptionDisableMarkdown() MsgOption
- func MsgOptionDisableMediaUnfurl() MsgOption
- func MsgOptionEnableLinkUnfurl() MsgOption
- func MsgOptionPost() MsgOption
- func MsgOptionPostMessageParameters(params PostMessageParameters) MsgOption
- func MsgOptionText(text string, escape bool) MsgOption
- func MsgOptionUpdate(timestamp string) MsgOption
- type OAuthResponse
- type OAuthResponseBot
- type OAuthResponseIncomingWebhook
- type OutgoingErrorEvent
- type OutgoingMessage
- type Pagination
- type Paging
- type PinAddedEvent
- type PinRemovedEvent
- type Ping
- type Pong
- type PostMessageParameters
- type PrefChangeEvent
- type PresenceChangeEvent
- type Purpose
- type RTM
- func (rtm *RTM) Disconnect() error
- func (rtm *RTM) GetInfo() *Info
- func (rtm *RTM) ManageConnection()
- func (rtm *RTM) NewOutgoingMessage(text string, channel string) *OutgoingMessage
- func (rtm *RTM) NewTypingMessage(channel string) *OutgoingMessage
- func (rtm *RTM) Reconnect() error
- func (rtm *RTM) SendMessage(msg *OutgoingMessage)
- type RTMError
- type RTMEvent
- type RTMOptions
- type RTMResponse
- type ReactedItem
- type ReactionAddedEvent
- type ReactionRemovedEvent
- type ReconnectUrlEvent
- type Reply
- type ResponseMessageParameters
- type SearchFiles
- type SearchMessage
- type SearchMessages
- type SearchParameters
- type SlackResponse
- type SnoozeDebug
- type SnoozeInfo
- type StarAddedEvent
- type StarRemovedEvent
- type StarredItem
- type StarsParameters
- type Team
- type TeamDomainChangeEvent
- type TeamIdentity
- type TeamInfo
- type TeamJoinEvent
- type TeamMigrationStartedEvent
- type TeamPrefChangeEvent
- type TeamRenameEvent
- type TeamResponse
- type Topic
- type Unfurl
- type UnfurlParameters
- type UnmarshallingErrorEvent
- type UpdateMessageParameters
- type User
- type UserChangeEvent
- type UserDetails
- type UserGroup
- type UserGroupPrefs
- type UserIdentity
- type UserIdentityResponse
- type UserPrefs
- type UserPresence
- type UserProfile
- type UserSetPhotoParams
- type UserTypingEvent
- type V2OAuthResponse
- type WebError
- type WebResponse
Constants ¶
const ( DEFAULT_MESSAGE_USERNAME = "" DEFAULT_MESSAGE_THREAD_TIMESTAMP = "" DEFAULT_MESSAGE_ASUSER = false DEFAULT_MESSAGE_PARSE = "" DEFAULT_MESSAGE_LINK_NAMES = 0 DEFAULT_MESSAGE_UNFURL_LINKS = false DEFAULT_MESSAGE_UNFURL_MEDIA = true DEFAULT_MESSAGE_ICON_URL = "" DEFAULT_MESSAGE_ICON_EMOJI = "" DEFAULT_MESSAGE_MARKDOWN = true DEFAULT_MESSAGE_ESCAPE_TEXT = true DEFAULT_MESSAGE_RESPONSE_TYPE = "in_channel" )
const ( // Add here the defaults in the siten DEFAULT_FILES_USER = "" DEFAULT_FILES_CHANNEL = "" DEFAULT_FILES_TS_FROM = 0 DEFAULT_FILES_TS_TO = -1 DEFAULT_FILES_TYPES = "all" DEFAULT_FILES_COUNT = 100 DEFAULT_FILES_PAGE = 1 )
const ( DEFAULT_HISTORY_LATEST = "" DEFAULT_HISTORY_OLDEST = "0" DEFAULT_HISTORY_COUNT = 100 DEFAULT_HISTORY_INCLUSIVE = false DEFAULT_HISTORY_UNREADS = false )
const ( TYPE_MESSAGE = "message" TYPE_FILE = "file" TYPE_FILE_COMMENT = "file_comment" TYPE_CHANNEL = "channel" TYPE_IM = "im" TYPE_GROUP = "group" )
const ( DEFAULT_REACTIONS_USER = "" DEFAULT_REACTIONS_COUNT = 100 DEFAULT_REACTIONS_PAGE = 1 DEFAULT_REACTIONS_FULL = false )
const ( DEFAULT_SEARCH_SORT = "score" DEFAULT_SEARCH_SORT_DIR = "desc" DEFAULT_SEARCH_HIGHLIGHT = false DEFAULT_SEARCH_COUNT = 100 DEFAULT_SEARCH_PAGE = 1 )
const ( DEFAULT_STARS_USER = "" DEFAULT_STARS_COUNT = 100 DEFAULT_STARS_PAGE = 1 )
const ( DEFAULT_LOGINS_COUNT = 100 DEFAULT_LOGINS_PAGE = 1 )
const ( DEFAULT_USER_PHOTO_CROP_X = -1 DEFAULT_USER_PHOTO_CROP_Y = -1 DEFAULT_USER_PHOTO_CROP_W = -1 )
const ( // MaxMessageTextLength is the current maximum message length in number of characters as defined here // https://api.slack.com/rtm#limits MaxMessageTextLength = 4000 )
Variables ¶
var HTTPClient = &http.Client{}
HTTPClient sets a custom http.Client deprecated: in favor of SetHTTPClient()
var SLACK_API string = "https://slack.com/api/"
Added as a var so that we can change this for testing purposes
var SLACK_WEB_API_FORMAT string = "https://%s.slack.com/api/users.admin.%s?t=%s"
Functions ¶
func ApplyMsgOptions ¶
ApplyMsgOptions utility function for debugging/testing chat requests.
func GetOAuthToken ¶
func GetOAuthToken(clientID, clientSecret, code, redirectURI string, debug bool) (accessToken string, scope string, err error)
GetOAuthToken retrieves an AccessToken
func GetOAuthTokenContext ¶
func GetOAuthTokenContext(ctx context.Context, clientID, clientSecret, code, redirectURI string, debug bool) (accessToken string, scope string, err error)
GetOAuthTokenContext retrieves an AccessToken with a custom context
func SetHTTPClient ¶
func SetHTTPClient(client HTTPRequester)
SetHTTPClient allows you to specify a custom http.Client Use this instead of the package level HTTPClient variable if you want to use a custom client like the Stackdriver Trace HTTPClient https://godoc.org/cloud.google.com/go/trace#HTTPClient
Types ¶
type AccessLogParameters ¶
AccessLogParameters contains all the parameters necessary (including the optional ones) for a GetAccessLogs() request
func NewAccessLogParameters ¶
func NewAccessLogParameters() AccessLogParameters
NewAccessLogParameters provides an instance of AccessLogParameters with all the sane default values set
type AccountsChangedEvent ¶
type AccountsChangedEvent struct {
Type string `json:"type"`
}
AccountsChangedEvent represents the accounts changed event
type AckErrorEvent ¶
type AckErrorEvent struct {
ErrorObj error
}
AckErrorEvent i
func (*AckErrorEvent) Error ¶
func (a *AckErrorEvent) Error() string
type AckMessage ¶
type AckMessage struct { ReplyTo int `json:"reply_to"` Timestamp string `json:"ts"` Text string `json:"text"` RTMResponse }
AckMessage is used for messages received in reply to other messages
type Attachment ¶
type Attachment struct { Color string `json:"color,omitempty"` Fallback string `json:"fallback"` CallbackID string `json:"callback_id,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorSubname string `json:"author_subname,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Pretext string `json:"pretext,omitempty"` Text string `json:"text"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` Fields []AttachmentField `json:"fields,omitempty"` Actions []AttachmentAction `json:"actions,omitempty"` MarkdownIn []string `json:"mrkdwn_in,omitempty"` Ts json.Number `json:"ts,omitempty"` }
Attachment contains all the information for an attachment
type AttachmentAction ¶
type AttachmentAction struct { Name string `json:"name"` // Required. Text string `json:"text"` // Required. Style string `json:"style,omitempty"` // Optional. Allowed values: "default", "primary", "danger". Type string `json:"type"` // Required. Must be set to "button" or "select". Value string `json:"value,omitempty"` // Optional. DataSource string `json:"data_source,omitempty"` // Optional. MinQueryLength int `json:"min_query_length,omitempty"` // Optional. Default value is 1. Options []AttachmentActionOption `json:"options,omitempty"` // Optional. Maximum of 100 options can be provided in each menu. SelectedOptions []AttachmentActionOption `json:"selected_options,omitempty"` // Optional. The first element of this array will be set as the pre-selected option for this menu. OptionGroups []AttachmentActionOptionGroup `json:"option_groups,omitempty"` // Optional. Confirm *ConfirmationField `json:"confirm,omitempty"` // Optional. }
AttachmentAction is a button or menu to be included in the attachment. Required when using message buttons or menus and otherwise not useful. A maximum of 5 actions may be provided per attachment.
type AttachmentActionCallback ¶
type AttachmentActionCallback struct { Actions []AttachmentAction `json:"actions"` CallbackID string `json:"callback_id"` Team Team `json:"team"` Channel Channel `json:"channel"` User User `json:"user"` OriginalMessage Message `json:"original_message"` ActionTs string `json:"action_ts"` MessageTs string `json:"message_ts"` AttachmentID string `json:"attachment_id"` Token string `json:"token"` ResponseURL string `json:"response_url"` }
AttachmentActionCallback is sent from Slack when a user clicks a button in an interactive message (aka AttachmentAction)
type AttachmentActionOption ¶
type AttachmentActionOption struct { Text string `json:"text"` // Required. Value string `json:"value"` // Required. Description string `json:"description,omitempty"` // Optional. Up to 30 characters. }
AttachmentActionOption the individual option to appear in action menu.
type AttachmentActionOptionGroup ¶
type AttachmentActionOptionGroup struct { Text string `json:"text"` // Required. Options []AttachmentActionOption `json:"options"` // Required. }
AttachmentActionOptionGroup is a semi-hierarchal way to list available options to appear in action menu.
type AttachmentField ¶
type AttachmentField struct { Title string `json:"title"` Value string `json:"value"` Short bool `json:"short"` }
AttachmentField contains information for an attachment field An Attachment can contain multiple of these
type AuthTestResponse ¶
type BillableInfoResponse ¶
type BillableInfoResponse struct { BillableInfo map[string]BillingActive `json:"billable_info"` SlackResponse }
type BillingActive ¶
type BillingActive struct {
BillingActive bool `json:"billing_active"`
}
type Bot ¶
type Bot struct { ID string `json:"id"` Name string `json:"name"` Deleted bool `json:"deleted"` Icons Icons `json:"icons"` }
Bot contains information about a bot
type BotAddedEvent ¶
BotAddedEvent represents the bot added event
type BotChangedEvent ¶
BotChangedEvent represents the bot changed event
type Channel ¶
type Channel struct { IsChannel bool `json:"is_channel"` IsGeneral bool `json:"is_general"` IsMember bool `json:"is_member"` // contains filtered or unexported fields }
Channel contains information about the channel
type ChannelArchiveEvent ¶
type ChannelArchiveEvent ChannelInfoEvent
ChannelArchiveEvent represents the Channel archive event
type ChannelCreatedEvent ¶
type ChannelCreatedEvent struct { Type string `json:"type"` Channel ChannelCreatedInfo `json:"channel"` EventTimestamp string `json:"event_ts"` }
ChannelCreatedEvent represents the Channel created event
type ChannelCreatedInfo ¶
type ChannelCreatedInfo struct { ID string `json:"id"` IsChannel bool `json:"is_channel"` Name string `json:"name"` Created int `json:"created"` Creator string `json:"creator"` }
ChannelCreatedInfo represents the information associated with the Channel created event
type ChannelDeletedEvent ¶
type ChannelDeletedEvent ChannelInfoEvent
ChannelDeletedEvent represents the Channel deleted event
type ChannelHistoryChangedEvent ¶
type ChannelHistoryChangedEvent struct { Type string `json:"type"` Latest string `json:"latest"` Timestamp string `json:"ts"` EventTimestamp string `json:"event_ts"` }
ChannelHistoryChangedEvent represents the Channel history changed event
type ChannelInfoEvent ¶
type ChannelInfoEvent struct { // channel_left // channel_deleted // channel_archive // channel_unarchive Type string `json:"type"` Channel string `json:"channel"` User string `json:"user,omitempty"` Timestamp string `json:"ts,omitempty"` }
ChannelInfoEvent represents the Channel info event
type ChannelJoinedEvent ¶
ChannelJoinedEvent represents the Channel joined event
type ChannelLeftEvent ¶
type ChannelLeftEvent ChannelInfoEvent
ChannelLeftEvent represents the Channel left event
type ChannelMarkedEvent ¶
type ChannelMarkedEvent ChannelInfoEvent
ChannelMarkedEvent represents the Channel marked event
type ChannelRenameEvent ¶
type ChannelRenameEvent struct { Type string `json:"type"` Channel ChannelRenameInfo `json:"channel"` Timestamp string `json:"event_ts"` }
ChannelRenameEvent represents the Channel rename event
type ChannelRenameInfo ¶
type ChannelRenameInfo struct { ID string `json:"id"` Name string `json:"name"` Created string `json:"created"` }
ChannelRenameInfo represents the information associated with a Channel rename event
type ChannelUnarchiveEvent ¶
type ChannelUnarchiveEvent ChannelInfoEvent
ChannelUnarchiveEvent represents the Channel unarchive event
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddPinContext ¶
AddPinContext pins an item in a channel with a custom context
func (*Client) AddReaction ¶
AddReaction adds a reaction emoji to a message, file or file comment.
func (*Client) AddReactionContext ¶
AddReactionContext adds a reaction emoji to a message, file or file comment with a custom context.
func (*Client) AddStarContext ¶
AddStarContext stars an item in a channel with a custom context
func (*Client) ArchiveChannel ¶
ArchiveChannel archives the given channel
func (*Client) ArchiveChannelContext ¶
ArchiveChannelContext archives the given channel with a custom context
func (*Client) ArchiveGroup ¶
ArchiveGroup archives a private group
func (*Client) ArchiveGroupContext ¶
ArchiveGroup archives a private group
func (*Client) AuthTest ¶
func (api *Client) AuthTest() (response *AuthTestResponse, error error)
AuthTest tests if the user is able to do authenticated requests or not
func (*Client) AuthTestContext ¶
func (api *Client) AuthTestContext(ctx context.Context) (response *AuthTestResponse, error error)
AuthTestContext tests if the user is able to do authenticated requests or not with a custom context
func (*Client) CloseGroup ¶
CloseGroup closes a private group
func (*Client) CloseGroupContext ¶
CloseGroupContext closes a private group with a custom context
func (*Client) CloseIMChannel ¶
CloseIMChannel closes the direct message channel
func (*Client) CloseIMChannelContext ¶
CloseIMChannelContext closes the direct message channel with a custom context
func (*Client) ConnectRTM ¶
ConnectRTM calls the "rtm.connect" endpoint and returns the provided URL and the compact Info block.
To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it.
func (*Client) ConnectRTMContext ¶
func (api *Client) ConnectRTMContext(ctx context.Context) (info *Info, websocketURL string, err error)
ConnectRTM calls the "rtm.connect" endpoint and returns the provided URL and the compact Info block with a custom context.
To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it.
func (*Client) CreateChannel ¶
CreateChannel creates a channel with the given name and returns a *Channel
func (*Client) CreateChannelContext ¶
CreateChannelContext creates a channel with the given name and returns a *Channel with a custom context
func (*Client) CreateChildGroup ¶
CreateChildGroup creates a new private group archiving the old one This method takes an existing private group and performs the following steps:
- Renames the existing group (from "example" to "example-archived").
- Archives the existing group.
- Creates a new group with the name of the existing group.
- Adds all members of the existing group to the new group.
func (*Client) CreateChildGroupContext ¶
CreateChildGroup creates a new private group archiving the old one with a custom context For more information see CreateChildGroup
func (*Client) CreateGroup ¶
CreateGroup creates a private group
func (*Client) CreateGroupContext ¶
CreateGroup creates a private group
func (*Client) CreateUserGroup ¶
CreateUserGroup creates a new user group
func (*Client) CreateUserGroupContext ¶
func (api *Client) CreateUserGroupContext(ctx context.Context, userGroup UserGroup) (UserGroup, error)
CreateUserGroupContext creates a new user group with a custom context
func (*Client) DeleteFile ¶
DeleteFile deletes a file
func (*Client) DeleteFileContext ¶
DeleteFileContext deletes a file with a custom context
func (*Client) DeleteMessage ¶
DeleteMessage deletes a message in a channel
func (*Client) DeleteMessageContext ¶
func (api *Client) DeleteMessageContext(ctx context.Context, channel, messageTimestamp string) (string, string, error)
DeleteMessageContext deletes a message in a channel with a custom context
func (*Client) DeleteUserPhoto ¶
DeleteUserPhoto deletes the current authenticated user's profile image
func (*Client) DeleteUserPhotoContext ¶
DeleteUserPhotoContext deletes the current authenticated user's profile image with a custom context
func (*Client) DisableUser ¶
DisableUser disabled a user account, given a user ID
func (*Client) DisableUserContext ¶
DisableUserContext disabled a user account, given a user ID with a custom context
func (*Client) DisableUserGroup ¶
DisableUserGroup disables an existing user group
func (*Client) DisableUserGroupContext ¶
func (api *Client) DisableUserGroupContext(ctx context.Context, userGroup string) (UserGroup, error)
DisableUserGroupContext disables an existing user group with a custom context
func (*Client) EnableUserGroup ¶
EnableUserGroup enables an existing user group
func (*Client) EnableUserGroupContext ¶
EnableUserGroupContext enables an existing user group with a custom context
func (*Client) EndDNDContext ¶
EndDNDContext ends the user's scheduled Do Not Disturb session with a custom context
func (*Client) EndSnoozeContext ¶
EndSnoozeContext ends the current user's snooze mode with a custom context
func (*Client) GetAccessLogs ¶
func (api *Client) GetAccessLogs(params AccessLogParameters) ([]Login, *Paging, error)
GetAccessLogs retrieves a page of logins according to the parameters given
func (*Client) GetAccessLogsContext ¶
func (api *Client) GetAccessLogsContext(ctx context.Context, params AccessLogParameters) ([]Login, *Paging, error)
GetAccessLogsContext retrieves a page of logins according to the parameters given with a custom context
func (*Client) GetBillableInfo ¶
func (api *Client) GetBillableInfo(user string) (map[string]BillingActive, error)
func (*Client) GetBillableInfoContext ¶
func (*Client) GetBillableInfoForTeam ¶
func (api *Client) GetBillableInfoForTeam() (map[string]BillingActive, error)
GetBillableInfoForTeam returns the billing_active status of all users on the team.
func (*Client) GetBillableInfoForTeamContext ¶
func (api *Client) GetBillableInfoForTeamContext(ctx context.Context) (map[string]BillingActive, error)
GetBillableInfoForTeamContext returns the billing_active status of all users on the team with a custom context
func (*Client) GetBotInfo ¶
GetBotInfo will retrieve the complete bot information
func (*Client) GetBotInfoContext ¶
GetBotInfoContext will retrieve the complete bot information using a custom context
func (*Client) GetChannelHistory ¶
func (api *Client) GetChannelHistory(channel string, params HistoryParameters) (*History, error)
GetChannelHistory retrieves the channel history
func (*Client) GetChannelHistoryContext ¶
func (api *Client) GetChannelHistoryContext(ctx context.Context, channel string, params HistoryParameters) (*History, error)
GetChannelHistoryContext retrieves the channel history with a custom context
func (*Client) GetChannelInfo ¶
GetChannelInfo retrieves the given channel
func (*Client) GetChannelInfoContext ¶
GetChannelInfoContext retrieves the given channel with a custom context
func (*Client) GetChannelReplies ¶
GetChannelReplies gets an entire thread (a message plus all the messages in reply to it).
func (*Client) GetChannelRepliesContext ¶
func (api *Client) GetChannelRepliesContext(ctx context.Context, channel, thread_ts string) ([]Message, error)
GetChannelRepliesContext gets an entire thread (a message plus all the messages in reply to it) with a custom context
func (*Client) GetChannels ¶
GetChannels retrieves all the channels
func (*Client) GetChannelsContext ¶
GetChannelsContext retrieves all the channels with a custom context
func (*Client) GetDNDInfo ¶
GetDNDInfo provides information about a user's current Do Not Disturb settings.
func (*Client) GetDNDInfoContext ¶
GetDNDInfoContext provides information about a user's current Do Not Disturb settings with a custom context.
func (*Client) GetDNDTeamInfo ¶
GetDNDTeamInfo provides information about a user's current Do Not Disturb settings.
func (*Client) GetDNDTeamInfoContext ¶
func (api *Client) GetDNDTeamInfoContext(ctx context.Context, users []string) (map[string]DNDStatus, error)
GetDNDTeamInfoContext provides information about a user's current Do Not Disturb settings with a custom context.
func (*Client) GetEmojiContext ¶
GetEmojiContext retrieves all the emojis with a custom context
func (*Client) GetFileInfo ¶
GetFileInfo retrieves a file and related comments
func (*Client) GetFileInfoContext ¶
func (api *Client) GetFileInfoContext(ctx context.Context, fileID string, count, page int) (*File, []Comment, *Paging, error)
GetFileInfoContext retrieves a file and related comments with a custom context
func (*Client) GetFiles ¶
func (api *Client) GetFiles(params GetFilesParameters) ([]File, *Paging, error)
GetFiles retrieves all files according to the parameters given
func (*Client) GetFilesContext ¶
func (api *Client) GetFilesContext(ctx context.Context, params GetFilesParameters) ([]File, *Paging, error)
GetFilesContext retrieves all files according to the parameters given with a custom context
func (*Client) GetGroupHistory ¶
func (api *Client) GetGroupHistory(group string, params HistoryParameters) (*History, error)
GetGroupHistory fetches all the history for a private group
func (*Client) GetGroupHistoryContext ¶
func (api *Client) GetGroupHistoryContext(ctx context.Context, group string, params HistoryParameters) (*History, error)
GetGroupHistoryContext fetches all the history for a private group with a custom context
func (*Client) GetGroupInfo ¶
GetGroupInfo retrieves the given group
func (*Client) GetGroupInfoContext ¶
GetGroupInfoContext retrieves the given group with a custom context
func (*Client) GetGroupsContext ¶
GetGroupsContext retrieves all groups with a custom context
func (*Client) GetIMChannels ¶
GetIMChannels returns the list of direct message channels
func (*Client) GetIMChannelsContext ¶
GetIMChannelsContext returns the list of direct message channels with a custom context
func (*Client) GetIMHistory ¶
func (api *Client) GetIMHistory(channel string, params HistoryParameters) (*History, error)
GetIMHistory retrieves the direct message channel history
func (*Client) GetIMHistoryContext ¶
func (api *Client) GetIMHistoryContext(ctx context.Context, channel string, params HistoryParameters) (*History, error)
GetIMHistoryContext retrieves the direct message channel history with a custom context
func (*Client) GetReactions ¶
func (api *Client) GetReactions(item ItemRef, params GetReactionsParameters) ([]ItemReaction, error)
GetReactions returns details about the reactions on an item.
func (*Client) GetReactionsContext ¶
func (api *Client) GetReactionsContext(ctx context.Context, item ItemRef, params GetReactionsParameters) ([]ItemReaction, error)
GetReactionsContext returns details about the reactions on an item with a custom context
func (*Client) GetStarred ¶
func (api *Client) GetStarred(params StarsParameters) ([]StarredItem, *Paging, error)
GetStarred returns a list of StarredItem items.
The user then has to iterate over them and figure out what they should be looking at according to what is in the Type.
for _, item := range items { switch c.Type { case "file_comment": log.Println(c.Comment) case "file": ... }
This function still exists to maintain backwards compatibility. I exposed it as returning []StarredItem, so it shall stay as StarredItem
func (*Client) GetStarredContext ¶
func (api *Client) GetStarredContext(ctx context.Context, params StarsParameters) ([]StarredItem, *Paging, error)
GetStarredContext returns a list of StarredItem items with a custom context
For more details see GetStarred
func (*Client) GetTeamInfo ¶
GetTeamInfo gets the Team Information of the user
func (*Client) GetTeamInfoContext ¶
GetTeamInfoContext gets the Team Information of the user with a custom context
func (*Client) GetUserGroupMembers ¶
GetUserGroupMembers will retrieve the current list of users in a group
func (*Client) GetUserGroupMembersContext ¶
func (api *Client) GetUserGroupMembersContext(ctx context.Context, userGroup string) ([]string, error)
GetUserGroupMembersContext will retrieve the current list of users in a group with a custom context
func (*Client) GetUserGroups ¶
GetUserGroups returns a list of user groups for the team
func (*Client) GetUserGroupsContext ¶
GetUserGroupsContext returns a list of user groups for the team with a custom context
func (*Client) GetUserIdentity ¶
func (api *Client) GetUserIdentity() (*UserIdentityResponse, error)
GetUserIdentity will retrieve user info available per identity scopes
func (*Client) GetUserIdentityContext ¶
func (api *Client) GetUserIdentityContext(ctx context.Context) (*UserIdentityResponse, error)
GetUserIdentityContext will retrieve user info available per identity scopes with a custom context
func (*Client) GetUserInfo ¶
GetUserInfo will retrieve the complete user information
func (*Client) GetUserInfoContext ¶
GetUserInfoContext will retrieve the complete user information with a custom context
func (*Client) GetUserPresence ¶
func (api *Client) GetUserPresence(user string) (*UserPresence, error)
GetUserPresence will retrieve the current presence status of given user.
func (*Client) GetUserPresenceContext ¶
GetUserPresenceContext will retrieve the current presence status of given user with a custom context.
func (*Client) GetUsersContext ¶
GetUsersContext returns the list of users (with their detailed information) with a custom context
func (*Client) InviteGuest ¶
InviteGuest invites a user to Slack as a single-channel guest
func (*Client) InviteGuestContext ¶
func (api *Client) InviteGuestContext(ctx context.Context, teamName, channel, firstName, lastName, emailAddress string) error
InviteGuestContext invites a user to Slack as a single-channel guest with a custom context
func (*Client) InviteRestricted ¶
func (api *Client) InviteRestricted(teamName, channel, firstName, lastName, emailAddress string) error
InviteRestricted invites a user to Slack as a restricted account
func (*Client) InviteRestrictedContext ¶
func (api *Client) InviteRestrictedContext(ctx context.Context, teamName, channel, firstName, lastName, emailAddress string) error
InviteRestrictedContext invites a user to Slack as a restricted account with a custom context
func (*Client) InviteToTeam ¶
InviteToTeam invites a user to a Slack team
func (*Client) InviteToTeamContext ¶
func (api *Client) InviteToTeamContext(ctx context.Context, teamName, firstName, lastName, emailAddress string) error
InviteToTeamContext invites a user to a Slack team with a custom context
func (*Client) InviteUserToChannel ¶
InviteUserToChannel invites a user to a given channel and returns a *Channel
func (*Client) InviteUserToChannelContext ¶
func (api *Client) InviteUserToChannelContext(ctx context.Context, channel, user string) (*Channel, error)
InviteUserToChannelCustom invites a user to a given channel and returns a *Channel with a custom context
func (*Client) InviteUserToGroup ¶
InviteUserToGroup invites a specific user to a private group
func (*Client) InviteUserToGroupContext ¶
func (api *Client) InviteUserToGroupContext(ctx context.Context, group, user string) (*Group, bool, error)
InviteUserToGroupContext invites a specific user to a private group with a custom context
func (*Client) JoinChannel ¶
JoinChannel joins the currently authenticated user to a channel
func (*Client) JoinChannelContext ¶
JoinChannelContext joins the currently authenticated user to a channel with a custom context
func (*Client) KickUserFromChannel ¶
KickUserFromChannel kicks a user from a given channel
func (*Client) KickUserFromChannelContext ¶
KickUserFromChannelContext kicks a user from a given channel with a custom context
func (*Client) KickUserFromGroup ¶
KickUserFromGroup kicks a user from a group
func (*Client) KickUserFromGroupContext ¶
KickUserFromGroupContext kicks a user from a group with a custom context
func (*Client) LeaveChannel ¶
LeaveChannel makes the authenticated user leave the given channel
func (*Client) LeaveChannelContext ¶
LeaveChannelContext makes the authenticated user leave the given channel with a custom context
func (*Client) LeaveGroup ¶
LeaveGroup makes authenticated user leave the group
func (*Client) LeaveGroupContext ¶
LeaveGroupContext makes authenticated user leave the group with a custom context
func (*Client) ListPinsContext ¶
ListPinsContext returns information about the items a user reacted to with a custom context.
func (*Client) ListReactions ¶
func (api *Client) ListReactions(params ListReactionsParameters) ([]ReactedItem, *Paging, error)
ListReactions returns information about the items a user reacted to.
func (*Client) ListReactionsContext ¶
func (api *Client) ListReactionsContext(ctx context.Context, params ListReactionsParameters) ([]ReactedItem, *Paging, error)
ListReactionsContext returns information about the items a user reacted to with a custom context.
func (*Client) ListStars ¶
func (api *Client) ListStars(params StarsParameters) ([]Item, *Paging, error)
ListStars returns information about the stars a user added
func (*Client) ListStarsContext ¶
func (api *Client) ListStarsContext(ctx context.Context, params StarsParameters) ([]Item, *Paging, error)
ListStarsContext returns information about the stars a user added with a custom context
func (*Client) MarkIMChannel ¶
MarkIMChannel sets the read mark of a direct message channel to a specific point
func (*Client) MarkIMChannelContext ¶
MarkIMChannelContext sets the read mark of a direct message channel to a specific point with a custom context
func (*Client) NewRTM ¶
NewRTM returns a RTM, which provides a fully managed connection to Slack's websocket-based Real-Time Messaging protocol.
func (*Client) NewRTMWithOptions ¶
func (api *Client) NewRTMWithOptions(options *RTMOptions) *RTM
NewRTMWithOptions returns a RTM, which provides a fully managed connection to Slack's websocket-based Real-Time Messaging protocol. This also allows to configure various options available for RTM API.
func (*Client) OpenGroupContext ¶
OpenGroupContext opens a private group with a custom context
func (*Client) OpenIMChannel ¶
OpenIMChannel opens a direct message channel to the user provided as argument Returns some status and the channel ID
func (*Client) OpenIMChannelContext ¶
func (api *Client) OpenIMChannelContext(ctx context.Context, user string) (bool, bool, string, error)
OpenIMChannelContext opens a direct message channel to the user provided as argument with a custom context Returns some status and the channel ID
func (*Client) PostDialog ¶
PostDialog sends a dialog in response to a Slash Command or Action.
func (*Client) PostMessage ¶
func (api *Client) PostMessage(channel, text string, params PostMessageParameters) (string, string, error)
PostMessage sends a message to a channel. Message is escaped by default according to https://api.slack.com/docs/formatting Use http://davestevens.github.io/slack-message-builder/ to help crafting your message.
func (*Client) PostMessageContext ¶
func (api *Client) PostMessageContext(ctx context.Context, channel, text string, params PostMessageParameters) (string, string, error)
PostMessageContext sends a message to a channel with a custom context For more details, see PostMessage documentation
func (*Client) PostResponse ¶
func (api *Client) PostResponse(responseUrl string, params ResponseMessageParameters) error
PostResponse sends a message in response to a Slash Command or Action. Message is escaped by default according to https://api.slack.com/docs/formatting Use http://davestevens.github.io/slack-message-builder/ to help crafting your message.
func (*Client) RemovePinContext ¶
RemovePinContext un-pins an item from a channel with a custom context
func (*Client) RemoveReaction ¶
RemoveReaction removes a reaction emoji from a message, file or file comment.
func (*Client) RemoveReactionContext ¶
RemoveReactionContext removes a reaction emoji from a message, file or file comment with a custom context.
func (*Client) RemoveStar ¶
RemoveStar removes a starred item from a channel
func (*Client) RemoveStarContext ¶
RemoveStarContext removes a starred item from a channel with a custom context
func (*Client) RenameChannel ¶
RenameChannel renames a given channel
func (*Client) RenameChannelContext ¶
func (api *Client) RenameChannelContext(ctx context.Context, channel, name string) (*Channel, error)
RenameChannelContext renames a given channel with a custom context
func (*Client) RenameGroup ¶
RenameGroup renames a group XXX: They return a channel, not a group. What is this crap? :( Inconsistent api it seems.
func (*Client) RenameGroupContext ¶
RenameGroupContext renames a group with a custom context
func (*Client) RevokeFilePublicURL ¶
RevokeFilePublicURL disables public/external sharing for a file
func (*Client) RevokeFilePublicURLContext ¶
RevokeFilePublicURLContext disables public/external sharing for a file with a custom context
func (*Client) Search ¶
func (api *Client) Search(query string, params SearchParameters) (*SearchMessages, *SearchFiles, error)
func (*Client) SearchContext ¶
func (api *Client) SearchContext(ctx context.Context, query string, params SearchParameters) (*SearchMessages, *SearchFiles, error)
func (*Client) SearchFiles ¶
func (api *Client) SearchFiles(query string, params SearchParameters) (*SearchFiles, error)
func (*Client) SearchFilesContext ¶
func (api *Client) SearchFilesContext(ctx context.Context, query string, params SearchParameters) (*SearchFiles, error)
func (*Client) SearchMessages ¶
func (api *Client) SearchMessages(query string, params SearchParameters) (*SearchMessages, error)
func (*Client) SearchMessagesContext ¶
func (api *Client) SearchMessagesContext(ctx context.Context, query string, params SearchParameters) (*SearchMessages, error)
func (*Client) SendMessage ¶
func (api *Client) SendMessage(channel string, options ...MsgOption) (string, string, string, error)
SendMessage more flexible method for configuring messages.
func (*Client) SendMessageContext ¶
func (api *Client) SendMessageContext(ctx context.Context, channel string, options ...MsgOption) (string, string, string, error)
SendMessageContext more flexible method for configuring messages with a custom context.
func (*Client) SendSSOBindingEmail ¶
SendSSOBindingEmail sends an SSO binding email to the specified user
func (*Client) SendSSOBindingEmailContext ¶
SendSSOBindingEmailContext sends an SSO binding email to the specified user with a custom context
func (*Client) SetChannelPurpose ¶
SetChannelPurpose sets the channel purpose and returns the purpose that was successfully set
func (*Client) SetChannelPurposeContext ¶
func (api *Client) SetChannelPurposeContext(ctx context.Context, channel, purpose string) (string, error)
SetChannelPurposeContext sets the channel purpose and returns the purpose that was successfully set with a custom context
func (*Client) SetChannelReadMark ¶
SetChannelReadMark sets the read mark of a given channel to a specific point Clients should try to avoid making this call too often. When needing to mark a read position, a client should set a timer before making the call. In this way, any further updates needed during the timeout will not generate extra calls (just one per channel). This is useful for when reading scroll-back history, or following a busy live channel. A timeout of 5 seconds is a good starting point. Be sure to flush these calls on shutdown/logout.
func (*Client) SetChannelReadMarkContext ¶
SetChannelReadMarkContext sets the read mark of a given channel to a specific point with a custom context For more details see SetChannelReadMark documentation
func (*Client) SetChannelTopic ¶
SetChannelTopic sets the channel topic and returns the topic that was successfully set
func (*Client) SetChannelTopicContext ¶
func (api *Client) SetChannelTopicContext(ctx context.Context, channel, topic string) (string, error)
SetChannelTopicContext sets the channel topic and returns the topic that was successfully set with a custom context
func (*Client) SetDebug ¶
SetDebug switches the api into debug mode When in debug mode, it logs various info about what its doing If you ever use this in production, don't call SetDebug(true)
func (*Client) SetGroupPurpose ¶
SetGroupPurpose sets the group purpose
func (*Client) SetGroupPurposeContext ¶
func (api *Client) SetGroupPurposeContext(ctx context.Context, group, purpose string) (string, error)
SetGroupPurposeContext sets the group purpose with a custom context
func (*Client) SetGroupReadMark ¶
SetGroupReadMark sets the read mark on a private group Clients should try to avoid making this call too often. When needing to mark a read position, a client should set a timer before making the call. In this way, any further updates needed during the timeout will not generate extra calls (just one per channel). This is useful for when reading scroll-back history, or following a busy live channel. A timeout of 5 seconds is a good starting point. Be sure to flush these calls on shutdown/logout.
func (*Client) SetGroupReadMarkContext ¶
SetGroupReadMarkContext sets the read mark on a private group with a custom context For more details see SetGroupReadMark
func (*Client) SetGroupTopic ¶
SetGroupTopic sets the group topic
func (*Client) SetGroupTopicContext ¶
SetGroupTopicContext sets the group topic with a custom context
func (*Client) SetRegular ¶
SetRegular enables the specified user
func (*Client) SetRegularContext ¶
SetRegularContext enables the specified user with a custom context
func (*Client) SetRestricted ¶
SetRestricted converts a user into a restricted account
func (*Client) SetRestrictedContext ¶
SetRestrictedContext converts a user into a restricted account with a custom context
func (*Client) SetSnooze ¶
SetSnooze adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration.
func (*Client) SetSnoozeContext ¶
SetSnooze adjusts the snooze duration for a user's Do Not Disturb settings with a custom context. For more information see the SetSnooze docs
func (*Client) SetUltraRestricted ¶
SetUltraRestricted converts a user into a single-channel guest
func (*Client) SetUltraRestrictedContext ¶
func (api *Client) SetUltraRestrictedContext(ctx context.Context, teamName, uid, channel string) error
SetUltraRestrictedContext converts a user into a single-channel guest with a custom context
func (*Client) SetUserAsActive ¶
SetUserAsActive marks the currently authenticated user as active
func (*Client) SetUserAsActiveContext ¶
SetUserAsActiveContext marks the currently authenticated user as active with a custom context
func (*Client) SetUserCustomStatus ¶
SetUserCustomStatus will set a custom status and emoji for the currently authenticated user. If statusEmoji is "" and statusText is not, the Slack API will automatically set it to ":speech_balloon:". Otherwise, if both are "" the Slack API will unset the custom status/emoji.
func (*Client) SetUserCustomStatusContext ¶
func (api *Client) SetUserCustomStatusContext(ctx context.Context, statusText, statusEmoji string) error
SetUserCustomStatusContext will set a custom status and emoji for the currently authenticated user with a custom context
For more information see SetUserCustomStatus
func (*Client) SetUserPhoto ¶
SetUserPhoto changes the currently authenticated user's profile image
func (*Client) SetUserPhotoContext ¶
func (api *Client) SetUserPhotoContext(ctx context.Context, image string, params UserSetPhotoParams) error
SetUserPhotoContext changes the currently authenticated user's profile image using a custom context
func (*Client) SetUserPresence ¶
SetUserPresence changes the currently authenticated user presence
func (*Client) SetUserPresenceContext ¶
SetUserPresenceContext changes the currently authenticated user presence with a custom context
func (*Client) ShareFilePublicURL ¶
ShareFilePublicURL enabled public/external sharing for a file
func (*Client) ShareFilePublicURLContext ¶
func (api *Client) ShareFilePublicURLContext(ctx context.Context, fileID string) (*File, []Comment, *Paging, error)
ShareFilePublicURLContext enabled public/external sharing for a file with a custom context
func (*Client) StartRTM ¶
StartRTM calls the "rtm.start" endpoint and returns the provided URL and the full Info block.
To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it.
func (*Client) StartRTMContext ¶
func (api *Client) StartRTMContext(ctx context.Context) (info *Info, websocketURL string, err error)
StartRTMContext calls the "rtm.start" endpoint and returns the provided URL and the full Info block with a custom context.
To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it.
func (*Client) UnarchiveChannel ¶
UnarchiveChannel unarchives the given channel
func (*Client) UnarchiveChannelContext ¶
UnarchiveChannelContext unarchives the given channel with a custom context
func (*Client) UnarchiveGroup ¶
UnarchiveGroup unarchives a private group
func (*Client) UnarchiveGroupContext ¶
UnarchiveGroup unarchives a private group
func (*Client) UnsetUserCustomStatus ¶
UnsetUserCustomStatus removes the custom status message for the currently authenticated user. This is a convenience method that wraps (*Client).SetUserCustomStatus().
func (*Client) UnsetUserCustomStatusContext ¶
UnsetUserCustomStatusContext removes the custom status message for the currently authenticated user with a custom context. This is a convenience method that wraps (*Client).SetUserCustomStatus().
func (*Client) UpdateMessage ¶
UpdateMessage updates a message in a channel
func (*Client) UpdateMessageContext ¶
func (api *Client) UpdateMessageContext(ctx context.Context, channel, timestamp, text string) (string, string, string, error)
UpdateMessage updates a message in a channel
func (*Client) UpdateMessageWithAttachments ¶
func (api *Client) UpdateMessageWithAttachments(ctx context.Context, channel string, params UpdateMessageParameters) (string, string, string, error)
UpdateMessageWithAttachments updates a message in a channel with attachments
func (*Client) UpdateUserGroup ¶
UpdateUserGroup will update an existing user group
func (*Client) UpdateUserGroupContext ¶
func (api *Client) UpdateUserGroupContext(ctx context.Context, userGroup UserGroup) (UserGroup, error)
UpdateUserGroupContext will update an existing user group with a custom context
func (*Client) UpdateUserGroupMembers ¶
UpdateUserGroupMembers will update the members of an existing user group
func (*Client) UpdateUserGroupMembersContext ¶
func (api *Client) UpdateUserGroupMembersContext(ctx context.Context, userGroup string, members string) (UserGroup, error)
UpdateUserGroupMembersContext will update the members of an existing user group with a custom context
func (*Client) UploadFile ¶
func (api *Client) UploadFile(params FileUploadParameters) (file *File, err error)
UploadFile uploads a file
func (*Client) UploadFileContext ¶
func (api *Client) UploadFileContext(ctx context.Context, params FileUploadParameters) (file *File, err error)
UploadFileContext uploads a file and setting a custom context
type CommandsChangedEvent ¶
type CommandsChangedEvent struct { Type string `json:"type"` EventTimestamp string `json:"event_ts"` }
CommandsChangedEvent represents the commands changed event
type Comment ¶
type Comment struct { ID string `json:"id,omitempty"` Created JSONTime `json:"created,omitempty"` Timestamp JSONTime `json:"timestamp,omitempty"` User string `json:"user,omitempty"` Comment string `json:"comment,omitempty"` }
Comment contains all the information relative to a comment
type ConfirmationField ¶
type ConfirmationField struct { Title string `json:"title,omitempty"` // Optional. Text string `json:"text"` // Required. OkText string `json:"ok_text,omitempty"` // Optional. Defaults to "Okay" DismissText string `json:"dismiss_text,omitempty"` // Optional. Defaults to "Cancel" }
ConfirmationField are used to ask users to confirm actions
type ConnectedEvent ¶
ConnectedEvent is used for when we connect to Slack
type ConnectingEvent ¶
type ConnectingEvent struct { Attempt int // 1 = first attempt, 2 = second attempt ConnectionCount int }
ConnectingEvent contains information about our connection attempt
type ConnectionErrorEvent ¶
ConnectionErrorEvent contains information about a connection error
func (*ConnectionErrorEvent) Error ¶
func (c *ConnectionErrorEvent) Error() string
type CtxChannel ¶
type CtxMessage ¶
type DNDStatus ¶
type DNDStatus struct { Enabled bool `json:"dnd_enabled"` NextStartTimestamp int `json:"next_dnd_start_ts"` NextEndTimestamp int `json:"next_dnd_end_ts"` SnoozeInfo }
type DNDUpdatedEvent ¶
type DNDUpdatedEvent struct { Type string `json:"type"` User string `json:"user"` Status DNDStatus `json:"dnd_status"` }
DNDUpdatedEvent represents the update event for Do Not Disturb
type Dialog ¶
type Dialog struct { CallbackID string `json:"callback_id"` Title string `json:"title"` SubmitLabel string `json:"submit_label"` NotifyOnCancel bool `json:"notify_on_cancel"` Elements []DialogElement `json:"elements"` }
Dialog object sent to Slack
type DialogElement ¶
type DialogElement struct { Type string `json:"type"` Label string `json:"label"` Name string `json:"name"` Subtype string `json:"subtype,omitempty"` MaxLength int `json:"max_length,omitempty"` MinLength int `json:"min_length,omitempty"` Optional bool `json:"optional,omitempty"` Hint string `json:"hint,omitempty"` Value string `json:"value,omitempty"` Placeholder string `json:"placeholder,omitempty"` Options []DialogOption `json:"options,omitempty"` OptionGroups []DialogOptionGroup `json:"option_groups,omitempty"` DataSource string `json:"data_source,omitempty"` MinQueryLength int `json:"min_query_length,omitempty"` SelectedOptions []DialogOption `json:"selected_options,omitempty"` }
Elements in dialog
type DialogOption ¶
type DialogOptionGroup ¶
type DialogOptionGroup struct { Label string `json:"label"` // Required. Options []DialogOption `json:"options"` // Required. }
AttachmentActionOptionGroup is a semi-hierarchal way to list available options to appear in action menu.
type DialogPost ¶
type DisconnectedEvent ¶
type DisconnectedEvent struct {
Intentional bool
}
DisconnectedEvent contains information about how we disconnected
type EmailDomainChangedEvent ¶
type EmailDomainChangedEvent struct { Type string `json:"type"` EventTimestamp string `json:"event_ts"` EmailDomain string `json:"email_domain"` }
EmailDomainChangedEvent represents the email domain changed event
type EmojiChangedEvent ¶
type EmojiChangedEvent struct { Type string `json:"type"` SubType string `json:"subtype"` Name string `json:"name"` Names []string `json:"names"` Value string `json:"value"` EventTimestamp string `json:"event_ts"` }
EmojiChangedEvent represents the emoji changed event
type Event ¶
type Event struct {
Type string `json:"type,omitempty"`
}
Event contains the event type
type File ¶
type File struct { ID string `json:"id"` Created JSONTime `json:"created"` Timestamp JSONTime `json:"timestamp"` Name string `json:"name"` Title string `json:"title"` Mimetype string `json:"mimetype"` ImageExifRotation int `json:"image_exif_rotation"` Filetype string `json:"filetype"` PrettyType string `json:"pretty_type"` User string `json:"user"` Mode string `json:"mode"` Editable bool `json:"editable"` IsExternal bool `json:"is_external"` ExternalType string `json:"external_type"` Size int `json:"size"` URL string `json:"url"` // Deprecated - never set URLDownload string `json:"url_download"` // Deprecated - never set URLPrivate string `json:"url_private"` URLPrivateDownload string `json:"url_private_download"` OriginalH int `json:"original_h"` OriginalW int `json:"original_w"` Thumb64 string `json:"thumb_64"` Thumb80 string `json:"thumb_80"` Thumb160 string `json:"thumb_160"` Thumb360 string `json:"thumb_360"` Thumb360Gif string `json:"thumb_360_gif"` Thumb360W int `json:"thumb_360_w"` Thumb360H int `json:"thumb_360_h"` Thumb480 string `json:"thumb_480"` Thumb480W int `json:"thumb_480_w"` Thumb480H int `json:"thumb_480_h"` Thumb720 string `json:"thumb_720"` Thumb720W int `json:"thumb_720_w"` Thumb720H int `json:"thumb_720_h"` Thumb960 string `json:"thumb_960"` Thumb960W int `json:"thumb_960_w"` Thumb960H int `json:"thumb_960_h"` Thumb1024 string `json:"thumb_1024"` Thumb1024W int `json:"thumb_1024_w"` Thumb1024H int `json:"thumb_1024_h"` Permalink string `json:"permalink"` PermalinkPublic string `json:"permalink_public"` EditLink string `json:"edit_link"` Preview string `json:"preview"` PreviewHighlight string `json:"preview_highlight"` Lines int `json:"lines"` LinesMore int `json:"lines_more"` IsPublic bool `json:"is_public"` Channels []string `json:"channels"` Groups []string `json:"groups"` IMs []string `json:"ims"` InitialComment Comment `json:"initial_comment"` CommentsCount int `json:"comments_count"` NumStars int `json:"num_stars"` IsStarred bool `json:"is_starred"` }
File contains all the information for a file
type FileChangeEvent ¶
type FileChangeEvent fileActionEvent
FileChangeEvent represents the File change event
type FileCommentAddedEvent ¶
type FileCommentAddedEvent struct { Comment Comment `json:"comment"` // contains filtered or unexported fields }
FileCommentAddedEvent represents the File comment added event
type FileCommentDeletedEvent ¶
type FileCommentDeletedEvent struct { Comment string `json:"comment"` // contains filtered or unexported fields }
FileCommentDeletedEvent represents the File comment deleted event
type FileCommentEditedEvent ¶
type FileCommentEditedEvent struct { Comment Comment `json:"comment"` // contains filtered or unexported fields }
FileCommentEditedEvent represents the File comment edited event
type FileCreatedEvent ¶
type FileCreatedEvent fileActionEvent
FileCreatedEvent represents the File created event
type FileDeletedEvent ¶
type FileDeletedEvent fileActionEvent
FileDeletedEvent represents the File deleted event
type FilePrivateEvent ¶
type FilePrivateEvent fileActionEvent
FilePrivateEvent represents the File private event
type FilePublicEvent ¶
type FilePublicEvent fileActionEvent
FilePublicEvent represents the File public event
type FileSharedEvent ¶
type FileSharedEvent fileActionEvent
FileSharedEvent represents the File shared event
type FileUnsharedEvent ¶
type FileUnsharedEvent fileActionEvent
FileUnsharedEvent represents the File unshared event
type FileUploadParameters ¶
type FileUploadParameters struct { File string Content string Reader io.Reader Filetype string Filename string Title string InitialComment string Channels []string }
FileUploadParameters contains all the parameters necessary (including the optional ones) for an UploadFile() request.
There are three ways to upload a file. You can either set Content if file is small, set Reader if file is large, or provide a local file path in File to upload it from your filesystem.
type GetFilesParameters ¶
type GetFilesParameters struct { User string Channel string TimestampFrom JSONTime TimestampTo JSONTime Types string Count int Page int }
GetFilesParameters contains all the parameters necessary (including the optional ones) for a GetFiles() request
func NewGetFilesParameters ¶
func NewGetFilesParameters() GetFilesParameters
NewGetFilesParameters provides an instance of GetFilesParameters with all the sane default values set
type GetReactionsParameters ¶
type GetReactionsParameters struct {
Full bool
}
GetReactionsParameters is the inputs to get reactions to an item.
func NewGetReactionsParameters ¶
func NewGetReactionsParameters() GetReactionsParameters
NewGetReactionsParameters initializes the inputs to get reactions to an item.
type Group ¶
type Group struct { IsGroup bool `json:"is_group"` // contains filtered or unexported fields }
Group contains all the information for a group
type GroupArchiveEvent ¶
type GroupArchiveEvent ChannelInfoEvent
GroupArchiveEvent represents the Group archive event
type GroupCloseEvent ¶
type GroupCloseEvent ChannelInfoEvent
GroupCloseEvent represents the Group close event
type GroupCreatedEvent ¶
type GroupCreatedEvent struct { Type string `json:"type"` User string `json:"user"` Channel ChannelCreatedInfo `json:"channel"` }
GroupCreatedEvent represents the Group created event
type GroupHistoryChangedEvent ¶
type GroupHistoryChangedEvent ChannelHistoryChangedEvent
GroupHistoryChangedEvent represents the Group history changed event
type GroupJoinedEvent ¶
type GroupJoinedEvent ChannelJoinedEvent
GroupJoinedEvent represents the Group joined event
type GroupLeftEvent ¶
type GroupLeftEvent ChannelInfoEvent
GroupLeftEvent represents the Group left event
type GroupMarkedEvent ¶
type GroupMarkedEvent ChannelInfoEvent
GroupMarkedEvent represents the Group marked event
type GroupOpenEvent ¶
type GroupOpenEvent ChannelInfoEvent
GroupOpenEvent represents the Group open event
type GroupRenameEvent ¶
type GroupRenameEvent struct { Type string `json:"type"` Group GroupRenameInfo `json:"channel"` Timestamp string `json:"ts"` }
GroupRenameEvent represents the Group rename event
type GroupRenameInfo ¶
type GroupRenameInfo struct { ID string `json:"id"` Name string `json:"name"` Created string `json:"created"` }
GroupRenameInfo represents the group info related to the renamed group
type GroupUnarchiveEvent ¶
type GroupUnarchiveEvent ChannelInfoEvent
GroupUnarchiveEvent represents the Group unarchive event
type HTTPRequester ¶
HTTPRequester defines the minimal interface needed for an http.Client to be implemented.
Use it in conjunction with the SetHTTPClient function to allow for other capabilities like a tracing http.Client
type History ¶
type History struct { Latest string `json:"latest"` Messages []Message `json:"messages"` HasMore bool `json:"has_more"` }
History contains message history information needed to navigate a Channel / Group / DM history
type HistoryParameters ¶
HistoryParameters contains all the necessary information to help in the retrieval of history for Channels/Groups/DMs
func NewHistoryParameters ¶
func NewHistoryParameters() HistoryParameters
NewHistoryParameters provides an instance of HistoryParameters with all the sane default values set
type IDGenerator ¶
type IDGenerator interface {
Next() int
}
IDGenerator provides an interface for generating integer ID values.
func NewSafeID ¶
func NewSafeID(startID int) IDGenerator
NewSafeID returns a new instance of an IDGenerator which is safe for concurrent use by multiple goroutines.
type IM ¶
type IM struct { IsIM bool `json:"is_im"` User string `json:"user"` IsUserDeleted bool `json:"is_user_deleted"` // contains filtered or unexported fields }
IM contains information related to the Direct Message channel
type IMCreatedEvent ¶
type IMCreatedEvent struct { Type string `json:"type"` User string `json:"user"` Channel ChannelCreatedInfo `json:"channel"` }
IMCreatedEvent represents the IM created event
type IMHistoryChangedEvent ¶
type IMHistoryChangedEvent ChannelHistoryChangedEvent
IMHistoryChangedEvent represents the IM history changed event
type IMMarkedEvent ¶
type IMMarkedEvent ChannelInfoEvent
IMMarkedEvent represents the IM marked event
type IMMarkedHistoryChanged ¶
type IMMarkedHistoryChanged ChannelInfoEvent
IMMarkedHistoryChanged represents the IM marked history changed event
type Icon ¶
type Icon struct { IconURL string `json:"icon_url,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` }
Icon is used for bot messages
type Icons ¶
type Icons struct { Image36 string `json:"image_36,omitempty"` Image48 string `json:"image_48,omitempty"` Image72 string `json:"image_72,omitempty"` }
Icons XXX: needs further investigation
type IncomingEventError ¶
type IncomingEventError struct {
ErrorObj error
}
IncomingEventError contains information about an unexpected error receiving a websocket event
func (*IncomingEventError) Error ¶
func (i *IncomingEventError) Error() string
type Info ¶
type Info struct { URL string `json:"url,omitempty"` User *UserDetails `json:"self,omitempty"` Team *Team `json:"team,omitempty"` Users []User `json:"users,omitempty"` Channels []Channel `json:"channels,omitempty"` Groups []Group `json:"groups,omitempty"` Bots []Bot `json:"bots,omitempty"` IMs []IM `json:"ims,omitempty"` }
Info contains various details about Users, Channels, Bots and the authenticated user. It is returned by StartRTM or included in the "ConnectedEvent" RTM event.
func (Info) GetBotByID ¶
GetBotByID returns a bot given a bot id
func (Info) GetChannelByID ¶
GetChannelByID returns a channel given a channel id
func (Info) GetGroupByID ¶
GetGroupByID returns a group given a group id
func (Info) GetUserByID ¶
GetUserByID returns a user given a user id
type InvalidAuthEvent ¶
type InvalidAuthEvent struct{}
InvalidAuthEvent is used in case we can't even authenticate with the API
type Item ¶
type Item struct { Type string `json:"type"` Channel string `json:"channel,omitempty"` Message *Message `json:"message,omitempty"` File *File `json:"file,omitempty"` Comment *Comment `json:"comment,omitempty"` Timestamp string `json:"ts,omitempty"` }
Item is any type of slack message - message, file, or file comment.
func NewChannelItem ¶
NewChannelItem turns a channel id into a typed channel struct.
func NewFileCommentItem ¶
NewFileCommentItem turns a file and comment into a typed file_comment struct.
func NewFileItem ¶
NewFileItem turns a file into a typed file struct.
func NewGroupItem ¶
NewGroupItem turns a channel id into a typed group struct.
func NewMessageItem ¶
NewMessageItem turns a message on a channel into a typed message struct.
type ItemReaction ¶
type ItemReaction struct { Name string `json:"name"` Count int `json:"count"` Users []string `json:"users"` }
ItemReaction is the reactions that have happened on an item.
type ItemRef ¶
type ItemRef struct { Channel string `json:"channel"` Timestamp string `json:"timestamp"` File string `json:"file"` Comment string `json:"file_comment"` }
ItemRef is a reference to a message of any type. One of FileID, CommentId, or the combination of ChannelId and Timestamp must be specified.
func NewRefToComment ¶
NewRefToComment initializes a reference to a file comment.
func NewRefToFile ¶
NewRefToFile initializes a reference to a file.
func NewRefToMessage ¶
NewRefToMessage initializes a reference to to a message.
type JSONTime ¶
type JSONTime int64
JSONTime exists so that we can have a String method converting the date
type LatencyReport ¶
LatencyReport contains information about connection latency
type ListReactionsParameters ¶
ListReactionsParameters is the inputs to find all reactions by a user.
func NewListReactionsParameters ¶
func NewListReactionsParameters() ListReactionsParameters
NewListReactionsParameters initializes the inputs to find all reactions performed by a user.
type Login ¶
type Login struct { UserID string `json:"user_id"` Username string `json:"username"` DateFirst int `json:"date_first"` DateLast int `json:"date_last"` Count int `json:"count"` IP string `json:"ip"` UserAgent string `json:"user_agent"` ISP string `json:"isp"` Country string `json:"country"` Region string `json:"region"` }
type LoginResponse ¶
type LoginResponse struct { Logins []Login `json:"logins"` Paging `json:"paging"` SlackResponse }
type ManualPresenceChangeEvent ¶
type ManualPresenceChangeEvent struct { Type string `json:"type"` Presence string `json:"presence"` }
ManualPresenceChangeEvent represents the manual presence change event
type MessageEvent ¶
type MessageEvent Message
MessageEvent represents a Slack Message (used as the event type for an incoming message)
type MessageTooLongEvent ¶
type MessageTooLongEvent struct { Message OutgoingMessage MaxLength int }
MessageTooLongEvent is used when sending a message that is too long
func (*MessageTooLongEvent) Error ¶
func (m *MessageTooLongEvent) Error() string
type Msg ¶
type Msg struct { // Basic Message Type string `json:"type,omitempty"` Channel string `json:"channel,omitempty"` User string `json:"user,omitempty"` Text string `json:"text,omitempty"` Timestamp string `json:"ts,omitempty"` ThreadTimestamp string `json:"thread_ts,omitempty"` IsStarred bool `json:"is_starred,omitempty"` PinnedTo []string `json:"pinned_to, omitempty"` Attachments []Attachment `json:"attachments,omitempty"` Edited *Edited `json:"edited,omitempty"` // Message Subtypes SubType string `json:"subtype,omitempty"` // Hidden Subtypes Hidden bool `json:"hidden,omitempty"` // message_changed, message_deleted, unpinned_item DeletedTimestamp string `json:"deleted_ts,omitempty"` // message_deleted EventTimestamp string `json:"event_ts,omitempty"` // bot_message (https://api.slack.com/events/message/bot_message) BotID string `json:"bot_id,omitempty"` Username string `json:"username,omitempty"` Icons *Icon `json:"icons,omitempty"` // channel_join, group_join Inviter string `json:"inviter,omitempty"` // channel_topic, group_topic Topic string `json:"topic,omitempty"` // channel_purpose, group_purpose Purpose string `json:"purpose,omitempty"` // channel_name, group_name Name string `json:"name,omitempty"` OldName string `json:"old_name,omitempty"` // channel_archive, group_archive Members []string `json:"members,omitempty"` // channels.replies, groups.replies, im.replies, mpim.replies ReplyCount int `json:"reply_count,omitempty"` Replies []Reply `json:"replies,omitempty"` ParentUserId string `json:"parent_user_id,omitempty"` // file_share, file_comment, file_mention File *File `json:"file,omitempty"` // file_share Upload bool `json:"upload,omitempty"` // file_comment Comment *Comment `json:"comment,omitempty"` // pinned_item ItemType string `json:"item_type,omitempty"` // https://api.slack.com/rtm ReplyTo int `json:"reply_to,omitempty"` Team string `json:"team,omitempty"` // reactions Reactions []ItemReaction `json:"reactions,omitempty"` }
Msg contains information about a slack message
type MsgOption ¶
type MsgOption func(*sendConfig) error
MsgOption option provided when sending a message.
func MsgOptionAsUser ¶
MsgOptionAsUser whether or not to send the message as the user.
func MsgOptionAttachments ¶
func MsgOptionAttachments(attachments ...Attachment) MsgOption
MsgOptionAttachments provide attachments for the message.
func MsgOptionDelete ¶
MsgOptionDelete deletes a message based on the timestamp.
func MsgOptionDisableMarkdown ¶
func MsgOptionDisableMarkdown() MsgOption
MsgOptionDisableMarkdown disables markdown.
func MsgOptionDisableMediaUnfurl ¶
func MsgOptionDisableMediaUnfurl() MsgOption
MsgOptionDisableMediaUnfurl disables media unfurling.
func MsgOptionEnableLinkUnfurl ¶
func MsgOptionEnableLinkUnfurl() MsgOption
MsgOptionEnableLinkUnfurl enables link unfurling
func MsgOptionPost ¶
func MsgOptionPost() MsgOption
MsgOptionPost posts a messages, this is the default.
func MsgOptionPostMessageParameters ¶
func MsgOptionPostMessageParameters(params PostMessageParameters) MsgOption
MsgOptionPostMessageParameters maintain backwards compatibility.
func MsgOptionText ¶
MsgOptionText provide the text for the message, optionally escape the provided text.
func MsgOptionUpdate ¶
MsgOptionUpdate updates a message based on the timestamp.
type OAuthResponse ¶
type OAuthResponse struct { AccessToken string `json:"access_token"` Scope string `json:"scope"` TeamName string `json:"team_name"` TeamID string `json:"team_id"` IncomingWebhook OAuthResponseIncomingWebhook `json:"incoming_webhook"` Bot OAuthResponseBot `json:"bot"` UserID string `json:"user_id,omitempty"` SlackResponse }
func GetOAuthResponse ¶
func GetOAuthResponse(clientID, clientSecret, code, redirectURI string, debug bool) (resp *OAuthResponse, err error)
func GetOAuthResponseContext ¶
type OAuthResponseBot ¶
type OutgoingErrorEvent ¶
type OutgoingErrorEvent struct { Message OutgoingMessage ErrorObj error }
OutgoingErrorEvent contains information in case there were errors sending messages
func (OutgoingErrorEvent) Error ¶
func (o OutgoingErrorEvent) Error() string
type OutgoingMessage ¶
type OutgoingMessage struct { ID int `json:"id"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` Type string `json:"type,omitempty"` ThreadTimestamp string `json:"thread_ts,omitempty"` }
OutgoingMessage is used for the realtime API, and seems incomplete.
type Pagination ¶
type Pagination struct { TotalCount int `json:"total_count"` Page int `json:"page"` PerPage int `json:"per_page"` PageCount int `json:"page_count"` First int `json:"first"` Last int `json:"last"` }
Pagination contains pagination information This is different from Paging in that it contains additional details
type Paging ¶
type Paging struct { Count int `json:"count"` Total int `json:"total"` Page int `json:"page"` Pages int `json:"pages"` }
Paging contains paging information
type PinRemovedEvent ¶
type PinRemovedEvent pinEvent
PinRemovedEvent represents the Pin removed event
type PostMessageParameters ¶
type PostMessageParameters struct { Text string `json:"text"` Username string `json:"user_name"` AsUser bool `json:"as_user"` Parse string `json:"parse"` ThreadTimestamp string `json:"thread_ts"` LinkNames int `json:"link_names"` Attachments []Attachment `json:"attachments"` UnfurlLinks bool `json:"unfurl_links"` UnfurlMedia bool `json:"unfurl_media"` IconURL string `json:"icon_url"` IconEmoji string `json:"icon_emoji"` Markdown bool `json:"mrkdwn,omitempty"` EscapeText bool `json:"escape_text"` }
PostMessageParameters contains all the parameters necessary (including the optional ones) for a PostMessage() request
func NewPostMessageParameters ¶
func NewPostMessageParameters() PostMessageParameters
NewPostMessageParameters provides an instance of PostMessageParameters with all the sane default values set
type PrefChangeEvent ¶
type PrefChangeEvent struct { Type string `json:"type"` Name string `json:"name"` Value json.RawMessage `json:"value"` }
PrefChangeEvent represents a user preferences change event
type PresenceChangeEvent ¶
type PresenceChangeEvent struct { Type string `json:"type"` Presence string `json:"presence"` User string `json:"user"` }
PresenceChangeEvent represents the presence change event
type Purpose ¶
type Purpose struct { Value string `json:"value"` Creator string `json:"creator"` LastSet JSONTime `json:"last_set"` }
Purpose contains information about the purpose
type RTM ¶
type RTM struct { IncomingEvents chan RTMEvent // Client is the main API, embedded Client // contains filtered or unexported fields }
RTM represents a managed websocket connection. It also supports all the methods of the `Client` type.
Create this element with Client's NewRTM() or NewRTMWithOptions(*RTMOptions)
func (*RTM) Disconnect ¶
Disconnect and wait, blocking until a successful disconnection.
func (*RTM) GetInfo ¶
GetInfo returns the info structure received when calling "startrtm", holding all channels, groups and other metadata needed to implement a full chat client. It will be non-nil after a call to StartRTM().
func (*RTM) ManageConnection ¶
func (rtm *RTM) ManageConnection()
ManageConnection can be called on a Slack RTM instance returned by the NewRTM method. It will connect to the slack RTM API and handle all incoming and outgoing events. If a connection fails then it will attempt to reconnect and will notify any listeners through an error event on the IncomingEvents channel.
If the connection ends and the disconnect was unintentional then this will attempt to reconnect.
This should only be called once per slack API! Otherwise expect undefined behavior.
The defined error events are located in websocket_internals.go.
func (*RTM) NewOutgoingMessage ¶
func (rtm *RTM) NewOutgoingMessage(text string, channel string) *OutgoingMessage
NewOutgoingMessage prepares an OutgoingMessage that the user can use to send a message. Use this function to properly set the messageID.
func (*RTM) NewTypingMessage ¶
func (rtm *RTM) NewTypingMessage(channel string) *OutgoingMessage
NewTypingMessage prepares an OutgoingMessage that the user can use to send as a typing indicator. Use this function to properly set the messageID.
func (*RTM) Reconnect ¶
Reconnect only makes sense if you've successfully disconnectd with Disconnect().
func (*RTM) SendMessage ¶
func (rtm *RTM) SendMessage(msg *OutgoingMessage)
SendMessage submits a simple message through the websocket. For more complicated messages, use `rtm.PostMessage` with a complete struct describing your attachments and all.
type RTMEvent ¶
type RTMEvent struct { Type string Data interface{} }
RTMEvent is the main wrapper. You will find all the other messages attached
type RTMOptions ¶
type RTMOptions struct { // UseRTMStart set to true in order to use rtm.start or false to use rtm.connect // As of 11th July 2017 you should prefer setting this to false, see: // https://api.slack.com/changelog/2017-04-start-using-rtm-connect-and-stop-using-rtm-start UseRTMStart bool }
RTMOptions allows configuration of various options available for RTM messaging
This structure will evolve in time so please make sure you are always using the named keys for every entry available as per Go 1 compatibility promise adding fields to this structure should not be considered a breaking change.
type RTMResponse ¶
RTMResponse encapsulates response details as returned by the Slack API
type ReactedItem ¶
type ReactedItem struct { Item Reactions []ItemReaction }
ReactedItem is an item that was reacted to, and the details of the reactions.
type ReactionAddedEvent ¶
type ReactionAddedEvent reactionEvent
ReactionAddedEvent represents the Reaction added event
type ReactionRemovedEvent ¶
type ReactionRemovedEvent reactionEvent
ReactionRemovedEvent represents the Reaction removed event
type ReconnectUrlEvent ¶
ReconnectUrlEvent represents the receiving reconnect url event
type ResponseMessageParameters ¶
type ResponseMessageParameters struct { Text string `json:"text"` ReplaceOriginal bool `json:"replace_original"` Attachments []Attachment `json:"attachments"` ResponseType string `json:"response_type"` AsUser bool `json:"as_user"` }
ResponseMessageParameters contains all the parameters necessary (including the optional ones) for a PostResponse() request
func NewResponseMessageParameters ¶
func NewResponseMessageParameters() ResponseMessageParameters
NewResponseMessageParameters provides an instance of ResponseMessageParameters with all the sane default values set
type SearchFiles ¶
type SearchFiles struct { Matches []File `json:"matches"` Paging `json:"paging"` Pagination `json:"pagination"` Total int `json:"total"` }
type SearchMessage ¶
type SearchMessage struct { Type string `json:"type"` Channel CtxChannel `json:"channel"` User string `json:"user"` Username string `json:"username"` Timestamp string `json:"ts"` Text string `json:"text"` Permalink string `json:"permalink"` Previous CtxMessage `json:"previous"` Previous2 CtxMessage `json:"previous_2"` Next CtxMessage `json:"next"` Next2 CtxMessage `json:"next_2"` }
type SearchMessages ¶
type SearchMessages struct { Matches []SearchMessage `json:"matches"` Paging `json:"paging"` Pagination `json:"pagination"` Total int `json:"total"` }
type SearchParameters ¶
func NewSearchParameters ¶
func NewSearchParameters() SearchParameters
type SlackResponse ¶
type SnoozeDebug ¶
type SnoozeDebug struct {
SnoozeEndDate string `json:"snooze_end_date"`
}
type SnoozeInfo ¶
type SnoozeInfo struct { SnoozeEnabled bool `json:"snooze_enabled,omitempty"` SnoozeEndTime int `json:"snooze_endtime,omitempty"` SnoozeRemaining int `json:"snooze_remaining,omitempty"` SnoozeDebug SnoozeDebug `json:"snooze_debug,omitempty"` }
type StarRemovedEvent ¶
type StarRemovedEvent starEvent
StarRemovedEvent represents the Star removed event
type StarredItem ¶
type StarredItem Item
type StarsParameters ¶
func NewStarsParameters ¶
func NewStarsParameters() StarsParameters
NewStarsParameters initialises StarsParameters with default values
type TeamDomainChangeEvent ¶
type TeamDomainChangeEvent struct { Type string `json:"type"` URL string `json:"url"` Domain string `json:"domain"` }
TeamDomainChangeEvent represents the Team domain change event
type TeamIdentity ¶
type TeamIdentity struct { ID string `json:"id"` Name string `json:"name"` Domain string `json:"domain"` Image34 string `json:"image_34"` Image44 string `json:"image_44"` Image68 string `json:"image_68"` Image88 string `json:"image_88"` Image102 string `json:"image_102"` Image132 string `json:"image_132"` Image230 string `json:"image_230"` ImageDefault bool `json:"image_default"` ImageOriginal string `json:"image_original"` }
type TeamJoinEvent ¶
TeamJoinEvent represents the Team join event
type TeamMigrationStartedEvent ¶
type TeamMigrationStartedEvent struct {
Type string `json:"type"`
}
TeamMigrationStartedEvent represents the Team migration started event
type TeamPrefChangeEvent ¶
type TeamPrefChangeEvent struct { Type string `json:"type"` Name string `json:"name,omitempty"` Value []string `json:"value,omitempty"` }
TeamPrefChangeEvent represents the Team preference change event
type TeamRenameEvent ¶
type TeamRenameEvent struct { Type string `json:"type"` Name string `json:"name,omitempty"` EventTimestamp string `json:"event_ts,omitempty"` }
TeamRenameEvent represents the Team rename event
type TeamResponse ¶
type TeamResponse struct { Team TeamInfo `json:"team"` SlackResponse }
type Topic ¶
type Topic struct { Value string `json:"value"` Creator string `json:"creator"` LastSet JSONTime `json:"last_set"` }
Topic contains information about the topic
type Unfurl ¶
type Unfurl struct { Attachment Attachment `json:"Attachment"` UnfurlURL string `json:"-"` }
type UnfurlParameters ¶
type UnfurlParameters struct { Timestamp string `json:"ts"` Unfurls []Unfurl `json:"-"` UserAuthRequired bool `json:"user_auth_required"` }
UnfurlParmaeters contains all the parameters necessary (including the optional ones) for a ChatUnfurl() request
type UnmarshallingErrorEvent ¶
type UnmarshallingErrorEvent struct {
ErrorObj error
}
UnmarshallingErrorEvent is used when there are issues deconstructing a response
func (UnmarshallingErrorEvent) Error ¶
func (u UnmarshallingErrorEvent) Error() string
type UpdateMessageParameters ¶
type UpdateMessageParameters struct { Timestamp string `json:"ts"` Text string `json:"text"` Attachments []Attachment `json:"attachments"` Parse string `json:"parse"` LinkNames int `json:"link_names"` AsUser bool `json:"as_user"` }
UpdateMessageParameters contains all the parameters necessary (including the optional ones) for a UpdateMessage() request
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Deleted bool `json:"deleted"` Color string `json:"color"` RealName string `json:"real_name"` TZ string `json:"tz,omitempty"` TZLabel string `json:"tz_label"` TZOffset int `json:"tz_offset"` Profile UserProfile `json:"profile"` IsBot bool `json:"is_bot"` 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"` Has2FA bool `json:"has_2fa"` HasFiles bool `json:"has_files"` Presence string `json:"presence"` }
User contains all the information of a user
type UserChangeEvent ¶
UserChangeEvent represents the user change event
type UserDetails ¶
type UserDetails struct { ID string `json:"id"` Name string `json:"name"` Created JSONTime `json:"created"` ManualPresence string `json:"manual_presence"` Prefs UserPrefs `json:"prefs"` }
UserDetails contains user details coming in the initial response from StartRTM
type UserGroup ¶
type UserGroup struct { ID string `json:"id"` TeamID string `json:"team_id"` IsUserGroup bool `json:"is_usergroup"` Name string `json:"name"` Description string `json:"description"` Handle string `json:"handle"` IsExternal bool `json:"is_external"` DateCreate JSONTime `json:"date_create"` DateUpdate JSONTime `json:"date_update"` DateDelete JSONTime `json:"date_delete"` AutoType string `json:"auto_type"` CreatedBy string `json:"created_by"` UpdatedBy string `json:"updated_by"` DeletedBy string `json:"deleted_by"` Prefs UserGroupPrefs `json:"prefs"` UserCount int `json:"user_count"` }
UserGroup contains all the information of a user group
type UserGroupPrefs ¶
UserGroupPrefs contains default channels and groups (private channels)
type UserIdentity ¶
type UserIdentity struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` 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"` Image512 string `json:"image_512"` }
type UserIdentityResponse ¶
type UserIdentityResponse struct { User UserIdentity `json:"user"` Team TeamIdentity `json:"team"` SlackResponse }
type UserPresence ¶
type UserPresence struct { Presence string `json:"presence,omitempty"` Online bool `json:"online,omitempty"` AutoAway bool `json:"auto_away,omitempty"` ManualAway bool `json:"manual_away,omitempty"` ConnectionCount int `json:"connection_count,omitempty"` LastActivity JSONTime `json:"last_activity,omitempty"` }
UserPresence contains details about a user online status
type UserProfile ¶
type UserProfile 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"` Skype string `json:"skype"` Phone string `json:"phone"` 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"` Title string `json:"title"` BotID string `json:"bot_id,omitempty"` ApiAppID string `json:"api_app_id,omitempty"` StatusText string `json:"status_text,omitempty"` StatusEmoji string `json:"status_emoji,omitempty"` }
UserProfile contains all the information details of a given user
type UserSetPhotoParams ¶
func NewUserSetPhotoParams ¶
func NewUserSetPhotoParams() UserSetPhotoParams
type UserTypingEvent ¶
type UserTypingEvent struct { Type string `json:"type"` User string `json:"user"` Channel string `json:"channel"` }
UserTypingEvent represents the user typing event
type V2OAuthResponse ¶
type V2OAuthResponse struct { Ok bool `json:"ok"` Error string `json:"error"` AccessToken string `json:"access_token"` TokenType string `json:"token_type"` Scope string `json:"scope"` BotUserID string `json:"bot_user_id"` AppID string `json:"app_id"` Team struct { Name string `json:"name"` ID string `json:"id"` } `json:"team"` Enterprise struct { Name string `json:"name"` ID string `json:"id"` } `json:"enterprise"` AuthedUser struct { ID string `json:"id"` Scope string `json:"scope"` AccessToken string `json:"access_token"` TokenType string `json:"token_type"` } `json:"authed_user"` }
func GetV2OAuthResponse ¶
func GetV2OAuthResponse(clientID, clientSecret, code, redirectURI string, debug bool) (resp *V2OAuthResponse, err error)
type WebResponse ¶
Source Files ¶
- admin.go
- attachments.go
- backoff.go
- bots.go
- channels.go
- chat.go
- comment.go
- conversation.go
- dialog.go
- dnd.go
- emoji.go
- files.go
- groups.go
- history.go
- im.go
- info.go
- item.go
- messageID.go
- messages.go
- misc.go
- oauth.go
- pagination.go
- pins.go
- reactions.go
- response.go
- rtm.go
- search.go
- slack.go
- stars.go
- team.go
- usergroups.go
- users.go
- websocket.go
- websocket_channels.go
- websocket_dm.go
- websocket_dnd.go
- websocket_files.go
- websocket_groups.go
- websocket_internals.go
- websocket_managed_conn.go
- websocket_misc.go
- websocket_pins.go
- websocket_proxy.go
- websocket_reactions.go
- websocket_stars.go
- websocket_teams.go
- websocket_utils.go