Documentation ¶
Index ¶
- func PostFile(token string, channel string, fileName string) error
- func PostSnippet(token string, fileType string, fileContent string, channel string, ...) error
- func Send(webhookURL string, proxy string, payload Payload) []error
- func Wrangler(webhookURL string, message string, myChannel string, emojiName string, ...)
- func WranglerDM(opts Slackopts, payload BotDMPayload) error
- type Attachment
- type BasicSlackPayload
- type BotDMPayload
- type Field
- type Payload
- type Slackopts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostSnippet ¶
func PostSnippet(token string, fileType string, fileContent string, channel string, title string, comment string) error
PostSnippet - Post a snippet of any type to slack channel
func Wrangler ¶
func Wrangler(webhookURL string, message string, myChannel string, emojiName string, botName string, attachments Attachment)
Wrangler - wrangle slack calls
func WranglerDM ¶
func WranglerDM(opts Slackopts, payload BotDMPayload) error
WranglerDM - Send chat.Post API DM messages "as the bot"
Types ¶
type Attachment ¶
type Attachment struct { Fallback string `json:"fallback,omitempty"` Color string `json:"color,omitempty"` PreText string `json:"pretext,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` Fields []*Field `json:"fields,omitempty"` Timestamp int64 `json:"ts,omitempty"` MarkdownIn []string `json:"mrkdwn_in,omitempty"` }
Attachment - struct
func (*Attachment) AddField ¶
func (attachment *Attachment) AddField(field Field) *Attachment
AddField - add fields
type BasicSlackPayload ¶
BasicSlackPayload - returns most basic slack response payload
type BotDMPayload ¶
type BotDMPayload struct { Token string `json:"token,omitempty"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` AsUser bool `json:"as_user,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` IconURL string `json:"icon_url,omitempty"` LinkNames bool `json:"link_names,omitempty"` Mkrdwn bool `json:"mrkdwn,omitempty"` Parse string `json:"parse,omitempty"` ReplyBroadcast bool `json:"reply_broadcast,omitempty"` ThreadTS string `json:"thread_ts,omitempty"` UnfurlLinks bool `json:"unfurl_links,omitempty"` UnfurlMedia bool `json:"unfurl_media,omitempty"` Username string `json:"username,omitempty"` }
BotDMPayload - struct for bot DMs
type Field ¶
type Field struct { Title string `json:"title"` Value string `json:"value"` Short bool `json:"short"` }
Field - struct
type Payload ¶
type Payload struct { Parse string `json:"parse,omitempty"` Username string `json:"username,omitempty"` IconURL string `json:"icon_url,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` LinkNames string `json:"link_names,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` UnfurlLinks bool `json:"unfurl_links,omitempty"` UnfurlMedia bool `json:"unfurl_media,omitempty"` }
Payload - struct
Click to show internal directories.
Click to hide internal directories.