Created
August 12, 2019 00:22
-
-
Save GeekTree0101/883a16308a9b1f135c450f3f6a448e13 to your computer and use it in GitHub Desktop.
Golang Slack Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SlackMessage is SlackMessage object | |
type SlackMessage struct { | |
Type string `json:"response_type"` // key: type default: in_channel | |
Text string `json:"text"` | |
Attatchments []SlackMessageAttachment `json:"attachments"` | |
} | |
// SlackMessageAttachment is SlackMessage attachment object | |
type SlackMessageAttachment struct { | |
Title string `json:"title"` | |
Text string `json:"text"` | |
Color string `json:"color"` | |
TitleURLString string `json:"title_link"` | |
Fields []SlackMessageAttachmentField `json:"fields"` | |
} | |
// SlackMessageAttachmentField is attachment fields | |
type SlackMessageAttachmentField struct { | |
Title string `json:"title"` | |
Value string `json:"value"` | |
Short bool `json:"shrot"` | |
} | |
// SlackCommand is commend request object | |
type SlackCommand struct { | |
Token string `json:"token"` | |
ChannelName string `json:"channel_name"` | |
Command string `json:"command"` | |
Text string `json:"text"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment