Documentation ¶
Index ¶
- Constants
- type Attachment
- type BasicIdentity
- type BlockBase
- type BlockElement
- type BlockTitle
- type File
- type FilesRemoteAddParameters
- type GetConversationHistoryParameters
- type Handler
- func (s Handler) AuthTest() (*BasicIdentity, error)
- func (s *Handler) ChatUnfURL(parameters UnfURLsParameters) error
- func (s *Handler) FilesUpload(file File, channels ...string) (*slack.File, error)
- func (s *Handler) GetMessage(channelID, timestamp string) (*Message, error)
- func (s *Handler) GetMessages(channelID, timestamp string, limit int) ([]Message, error)
- func (s Handler) GetUserIdentity() (identity *UserIdentity, err error)
- func (s Handler) GetUserProfile(user string, includeLabels bool) (profile *UserProfile, err error)
- func (s Handler) Remove(channel, ts string) (string, error)
- func (s *Handler) Send(message Message) (string, error)
- func (s Handler) SetUserProfile(user string, name string, value string) (profile *UserProfile, err error)
- func (s *Handler) Update(message Message) (string, error)
- type Message
- type ProfileLabel
- type UnfURL
- type UnfURLs
- type UnfURLsParameters
- type UserIdentity
- type UserProfile
Constants ¶
View Source
const SlackAPIEndpoint = "https://slack.com/api"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Color string `json:"color,omitempty"` Fallback string `json:"fallback,omitempty"` CallbackID string `json:"callback_id,omitempty"` ID int `json:"id,omitempty"` AuthorID string `json:"author_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,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ServiceName string `json:"service_name,omitempty"` ServiceIcon string `json:"service_icon,omitempty"` FromURL string `json:"from_url,omitempty"` OriginalURL string `json:"original_url,omitempty"` Fields []slack.AttachmentField `json:"fields,omitempty"` Actions []slack.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 BasicIdentity ¶
type BlockBase ¶
type BlockBase struct { Type string `json:"type"` Text BlockElement `json:"text,omitempty"` Elements []BlockElement `json:"elements,omitempty"` ImageURL string `json:"image_url"` AltText string `json:"alt_text"` Title BlockTitle `json:"title"` ExternalID string `json:"external_id"` Source string `json:"source"` }
func ContextBlock ¶
func ContextBlock(elements ...BlockElement) BlockBase
func DividerBlock ¶
func DividerBlock() BlockBase
func ImageBlock ¶
func SectionBlock ¶
func SectionBlock() BlockBase
func (BlockBase) MarshalJSON ¶
type BlockElement ¶
type BlockElement struct { Type string `json:"type,omitempty"` ImageURL string `json:"image_url,omitempty"` AltText string `json:"alt_text,omitempty"` Text string `json:"text,omitempty"` }
func ImageElement ¶
func ImageElement(imageURL, altText string) BlockElement
func MrkdwnElement ¶
func MrkdwnElement(text string) BlockElement
type BlockTitle ¶
type BlockTitle struct { Type string `json:"type,omitempty"` Text string `json:"text,omitempty"` Emoji bool `json:"emoji,omitempty"` }
func ImageTitle ¶
func ImageTitle(title string, emoji bool) BlockTitle
type Handler ¶
type Handler struct { Identity BasicIdentity // contains filtered or unexported fields }
func (Handler) AuthTest ¶
func (s Handler) AuthTest() (*BasicIdentity, error)
func (*Handler) ChatUnfURL ¶
func (s *Handler) ChatUnfURL(parameters UnfURLsParameters) error
func (*Handler) FilesUpload ¶
func (*Handler) GetMessage ¶
func (*Handler) GetMessages ¶
func (Handler) GetUserIdentity ¶
func (s Handler) GetUserIdentity() (identity *UserIdentity, err error)
func (Handler) GetUserProfile ¶
func (s Handler) GetUserProfile(user string, includeLabels bool) (profile *UserProfile, err error)
func (Handler) SetUserProfile ¶
type Message ¶
type Message struct { TS string `json:"ts,omitempty"` Channel string `json:"channel"` Type string `json:"type,omitempty"` Text string `json:"text,omitempty"` Blocks []BlockBase `json:"blocks,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` LinkNames bool `json:"link_names,omitempty"` Username string `json:"username,omitempty"` User string `json:"user,omitempty"` AsUser bool `json:"as_user,omitempty"` Parse string `json:"parse,omitempty"` ThreadTimestamp string `json:"thread_ts,omitempty"` ReplyBroadcast bool `json:"reply_broadcast,omitempty"` UnfurlLinks bool `json:"unfurl_links"` UnfurlMedia bool `json:"unfurl_media"` IconURL string `json:"icon_url,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` }
HookMessage SlackにIncommingWebhook経由のMessage送信形式
type ProfileLabel ¶
type UnfURLsParameters ¶
type UnfURLsParameters struct { Channel string `json:"channel"` TimeStamp string `json:"ts"` UnfURLs UnfURLs `json:"unfurls"` Source string `json:"source,omitempty"` UnfUrlID string `json:"unfurl_id,omitempty"` UserAuthBlocks []BlockBase `json:"user_auth_blocks,omitempty"` UserAuthRequired bool `json:"user_auth_required,omitempty"` }
type UserIdentity ¶
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"` DisplayName string `json:"display_name"` DisplayNameNormalized string `json:"display_name_normalized"` Email string `json:"email,omitempty"` Skype string `json:"skype,omitempty"` Phone string `json:"phone,omitempty"` 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"` ImageOriginal string `json:"image_original"` StatusText string `json:"status_text,omitempty"` StatusEmoji string `json:"status_emoji,omitempty"` StatusExpiration int `json:"status_expiration"` Team string `json:"team"` Fields map[string]ProfileLabel `json:"fields"` }
UserProfile contains all the information details of a given user
Click to show internal directories.
Click to hide internal directories.