Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeText int = 1 + iota ContentTypeImage ContentTypeVideo ContentTypeAudio ContentTypeUndefined5 ContentTypeUndefined6 ContentTypeLocation ContentTypeSticker ContentTypeUndefined9 ContentTypeContact )
ContentType constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API represents LINE BOT API
func (*API) DecodeMessage ¶
func (api *API) DecodeMessage(body io.Reader) (*ReceivedMessage, error)
DecodeMessage decodes body to ReceivedMessage struct.
func (*API) GetUserProfiles ¶
func (api *API) GetUserProfiles(userMIDs []string) (*UserProfiles, error)
GetUserProfiles obtains profiles of users
func (*API) SendMessage ¶
SendMessage sends a text to LINE
type Content ¶
type Content struct { ID string `json:"id"` ContentType int `json:"contentType"` From string `json:"from"` CreatedTime int `json:"createdTime"` To []string `json:"to"` ToType int `json:"toType"` ConentMetadata ContentMetadata `json:"contentMetadata"` Text string `json:"text"` Location Location `json:"location"` }
Content is a content of a message
type ContentMetadata ¶
type ContentMetadata struct { STKPKGID string `json:"STKPKGID"` STKID string `json:"STKID"` STKVER string `json:"STKVER"` STKTXT string `json:"STKTXT"` Mid string `json:"mid"` DisplayName string `json:"displayName"` }
ContentMetadata is a metadata of content
type Location ¶
type Location struct { Title string `json:"title"` Address string `json:"address"` Latitude int `json:"latitude"` Longitude int `json:"Longitude"` }
Location is a location related data
type ReceivedMessage ¶
type ReceivedMessage struct {
Results []Result `json:"result"`
}
ReceivedMessage is a body of callback sent by LINE
type Response ¶
type Response struct { Failed []interface{} `json:"failed"` MessageID string `json:"messageId"` Timestamp float64 `json:"timestamp"` Version int `json:"version"` }
Response is a body returned by LINE
type Result ¶
type Result struct { ID string `json:"id"` From string `json:"from"` FromChannel int `json:"fromChannel"` To []string `json:"to"` ToChannel int `json:"toChannel"` EventType string `json:"eventType"` Content Content `json:"content"` }
Result is a message or a operation.
type SendingMessage ¶
type SendingMessage struct { To []string `json:"to"` ToChannel int `json:"toChannel"` EventType string `json:"eventType"` Content Content `json:"content"` }
SendingMessage is a body for Posting API
type UserProfile ¶
type UserProfile struct { DisplayName string `json:"displayName"` Mid string `json:"mid"` PictureURL string `json:"pictureUrl"` StatusMessage string `json:"statusMessage"` }
UserProfile is user's profile
type UserProfiles ¶
type UserProfiles struct { Contacts []UserProfile `json:"contacts"` Count int `json:"count"` Total int `json:"total"` Start int `json:"start"` Display int `json:"display"` }
UserProfiles is users' profile
Click to show internal directories.
Click to hide internal directories.