linebot

package
v6.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 16 Imported by: 445

Documentation

Index

Examples

Constants

View Source
const (
	APIEndpointBase = "https://api.line.me"

	APIEndpointPushMessage           = "/v2/bot/message/push"
	APIEndpointReplyMessage          = "/v2/bot/message/reply"
	APIEndpointMulticast             = "/v2/bot/message/multicast"
	APIEndpointGetMessageContent     = "/v2/bot/message/%s/content"
	APIEndpointLeaveGroup            = "/v2/bot/group/%s/leave"
	APIEndpointLeaveRoom             = "/v2/bot/room/%s/leave"
	APIEndpointGetProfile            = "/v2/bot/profile/%s"
	APIEndpointGetGroupMemberProfile = "/v2/bot/group/%s/member/%s"
	APIEndpointGetRoomMemberProfile  = "/v2/bot/room/%s/member/%s"
	APIEndpointGetGroupMemberIDs     = "/v2/bot/group/%s/members/ids"
	APIEndpointGetRoomMemberIDs      = "/v2/bot/room/%s/members/ids"
	APIEndpointCreateRichMenu        = "/v2/bot/richmenu"
	APIEndpointGetRichMenu           = "/v2/bot/richmenu/%s"
	APIEndpointListRichMenu          = "/v2/bot/richmenu/list"
	APIEndpointDeleteRichMenu        = "/v2/bot/richmenu/%s"
	APIEndpointGetUserRichMenu       = "/v2/bot/user/%s/richmenu"
	APIEndpointLinkUserRichMenu      = "/v2/bot/user/%s/richmenu/%s"
	APIEndpointUnlinkUserRichMenu    = "/v2/bot/user/%s/richmenu"
	APIEndpointSetDefaultRichMenu    = "/v2/bot/user/all/richmenu/%s"
	APIEndpointDefaultRichMenu       = "/v2/bot/user/all/richmenu"   // Get: GET / Delete: DELETE
	APIEndpointDownloadRichMenuImage = "/v2/bot/richmenu/%s/content" // Download: GET / Upload: POST
	APIEndpointUploadRichMenuImage   = "/v2/bot/richmenu/%s/content" // Download: GET / Upload: POST

	APIEndpointGetAllLIFFApps = "/liff/v1/apps"
	APIEndpointAddLIFFApp     = "/liff/v1/apps"
	APIEndpointUpdateLIFFApp  = "/liff/v1/apps/%s/view"
	APIEndpointDeleteLIFFApp  = "/liff/v1/apps/%s"

	APIEndpointLinkToken = "/v2/bot/user/%s/linkToken"
)

APIEndpoint constants

Variables

View Source
var (
	ErrInvalidSignature = errors.New("invalid signature")
)

errors

Functions

func IntPtr

func IntPtr(v int) *int

IntPtr is a helper function for using *int values

Types

type APIError

type APIError struct {
	Code     int
	Response *ErrorResponse
}

APIError type

func (*APIError) Error

func (e *APIError) Error() string

Error method

type AccountLink struct {
	Result AccountLinkResult
	Nonce  string
}

AccountLink type

type AccountLinkResult added in v1.2.1

type AccountLinkResult string

AccountLinkResult type

const (
	AccountLinkResultOK     AccountLinkResult = "ok"
	AccountLinkResultFailed AccountLinkResult = "failed"
)

AccountLinkResult constants

type Action

type Action interface {
	json.Marshaler
}

Action interface

type ActionType

type ActionType string

ActionType type

const (
	ActionTypeURI            ActionType = "uri"
	ActionTypeMessage        ActionType = "message"
	ActionTypePostback       ActionType = "postback"
	ActionTypeDatetimePicker ActionType = "datetimepicker"
	ActionTypeCamera         ActionType = "camera"
	ActionTypeCameraRoll     ActionType = "cameraRoll"
	ActionTypeLocation       ActionType = "location"
)

ActionType constants

type AddLIFFCall added in v1.2.1

type AddLIFFCall struct {
	// contains filtered or unexported fields
}

AddLIFFCall type

func (*AddLIFFCall) Do added in v1.2.1

func (call *AddLIFFCall) Do() (*LIFFIDResponse, error)

Do method

func (*AddLIFFCall) WithContext added in v1.2.1

func (call *AddLIFFCall) WithContext(ctx context.Context) *AddLIFFCall

WithContext method

type AreaDetail added in v1.1.0

type AreaDetail struct {
	Bounds RichMenuBounds `json:"bounds"`
	Action RichMenuAction `json:"action"`
}

AreaDetail type for areas array

type AudioMessage

type AudioMessage struct {
	ID                 string
	OriginalContentURL string
	Duration           int
	// contains filtered or unexported fields
}

AudioMessage type

func NewAudioMessage

func NewAudioMessage(originalContentURL string, duration int) *AudioMessage

NewAudioMessage function

func (*AudioMessage) MarshalJSON

func (m *AudioMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of AudioMessage

func (*AudioMessage) Message added in v1.1.0

func (*AudioMessage) Message()

Message implements Message interface

func (*AudioMessage) WithQuickReplies

func (m *AudioMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of AudioMessage

type BasicResponse

type BasicResponse struct {
}

BasicResponse type

type Beacon

type Beacon struct {
	Hwid          string
	Type          BeaconEventType
	DeviceMessage []byte
}

Beacon type

type BeaconEventType

type BeaconEventType string

BeaconEventType type

const (
	BeaconEventTypeEnter  BeaconEventType = "enter"
	BeaconEventTypeLeave  BeaconEventType = "leave"
	BeaconEventTypeBanner BeaconEventType = "banner"
)

BeaconEventType constants

type BlockStyle added in v1.2.0

type BlockStyle struct {
	BackgroundColor string `json:"backgroundColor,omitempty"`
	Separator       bool   `json:"separator,omitempty"`
	SeparatorColor  string `json:"separatorColor,omitempty"`
}

BlockStyle type

type BoxComponent added in v1.2.0

type BoxComponent struct {
	Type     FlexComponentType
	Layout   FlexBoxLayoutType
	Contents []FlexComponent
	Flex     *int
	Spacing  FlexComponentSpacingType
	Margin   FlexComponentMarginType
}

BoxComponent type

func (*BoxComponent) FlexComponent added in v1.2.0

func (*BoxComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*BoxComponent) MarshalJSON

func (c *BoxComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of BoxComponent

func (*BoxComponent) UnmarshalJSON added in v1.2.0

func (c *BoxComponent) UnmarshalJSON(data []byte) error

UnmarshalJSON method for BoxComponent

type BubbleContainer added in v1.2.0

type BubbleContainer struct {
	Type      FlexContainerType
	Direction FlexBubbleDirectionType
	Header    *BoxComponent
	Hero      *ImageComponent
	Body      *BoxComponent
	Footer    *BoxComponent
	Styles    *BubbleStyle
}

BubbleContainer type

func (*BubbleContainer) FlexContainer added in v1.2.0

func (*BubbleContainer) FlexContainer()

FlexContainer implements FlexContainer interface

func (*BubbleContainer) MarshalJSON

func (c *BubbleContainer) MarshalJSON() ([]byte, error)

MarshalJSON method of BubbleContainer

type BubbleStyle added in v1.2.0

type BubbleStyle struct {
	Header *BlockStyle `json:"header,omitempty"`
	Hero   *BlockStyle `json:"hero,omitempty"`
	Body   *BlockStyle `json:"body,omitempty"`
	Footer *BlockStyle `json:"footer,omitempty"`
}

BubbleStyle type

type ButtonComponent added in v1.2.0

type ButtonComponent struct {
	Type    FlexComponentType
	Action  TemplateAction
	Flex    *int
	Margin  FlexComponentMarginType
	Height  FlexButtonHeightType
	Style   FlexButtonStyleType
	Color   string
	Gravity FlexComponentGravityType
}

ButtonComponent type

func (*ButtonComponent) FlexComponent added in v1.2.0

func (*ButtonComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*ButtonComponent) MarshalJSON

func (c *ButtonComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of ButtonComponent

func (*ButtonComponent) UnmarshalJSON added in v1.2.0

func (c *ButtonComponent) UnmarshalJSON(data []byte) error

UnmarshalJSON method for ButtonComponent

type ButtonsTemplate

type ButtonsTemplate struct {
	ThumbnailImageURL    string
	ImageAspectRatio     ImageAspectRatioType
	ImageSize            ImageSizeType
	ImageBackgroundColor string
	Title                string
	Text                 string
	Actions              []TemplateAction
}

ButtonsTemplate type

func NewButtonsTemplate

func NewButtonsTemplate(thumbnailImageURL, title, text string, actions ...TemplateAction) *ButtonsTemplate

NewButtonsTemplate function `thumbnailImageURL` and `title` are optional. they can be empty.

func (*ButtonsTemplate) MarshalJSON

func (t *ButtonsTemplate) MarshalJSON() ([]byte, error)

MarshalJSON method of ButtonsTemplate

func (*ButtonsTemplate) Template added in v1.1.0

func (*ButtonsTemplate) Template()

Template implements Template interface

func (*ButtonsTemplate) WithImageOptions added in v1.1.0

func (t *ButtonsTemplate) WithImageOptions(imageAspectRatio ImageAspectRatioType, imageSize ImageSizeType, imageBackgroundColor string) *ButtonsTemplate

WithImageOptions method, ButtonsTemplate can set imageAspectRatio, imageSize and imageBackgroundColor

type CameraAction

type CameraAction struct {
	Label string
}

CameraAction type

func NewCameraAction

func NewCameraAction(label string) *CameraAction

NewCameraAction function

func (*CameraAction) MarshalJSON

func (a *CameraAction) MarshalJSON() ([]byte, error)

MarshalJSON method of CameraAction

func (*CameraAction) QuickReplyAction

func (*CameraAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

type CameraRollAction

type CameraRollAction struct {
	Label string
}

CameraRollAction type

func NewCameraRollAction

func NewCameraRollAction(label string) *CameraRollAction

NewCameraRollAction function

func (*CameraRollAction) MarshalJSON

func (a *CameraRollAction) MarshalJSON() ([]byte, error)

MarshalJSON method of CameraRollAction

func (*CameraRollAction) QuickReplyAction

func (*CameraRollAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

type CancelDefaultRichMenuCall

type CancelDefaultRichMenuCall struct {
	// contains filtered or unexported fields
}

CancelDefaultRichMenuCall type

func (*CancelDefaultRichMenuCall) Do

Do method

func (*CancelDefaultRichMenuCall) WithContext

WithContext method

type CarouselColumn

type CarouselColumn struct {
	ThumbnailImageURL    string           `json:"thumbnailImageUrl,omitempty"`
	ImageBackgroundColor string           `json:"imageBackgroundColor,omitempty"`
	Title                string           `json:"title,omitempty"`
	Text                 string           `json:"text"`
	Actions              []TemplateAction `json:"actions"`
}

CarouselColumn type

func NewCarouselColumn

func NewCarouselColumn(thumbnailImageURL, title, text string, actions ...TemplateAction) *CarouselColumn

NewCarouselColumn function `thumbnailImageURL` and `title` are optional. they can be empty.

func (*CarouselColumn) WithImageOptions added in v1.1.0

func (t *CarouselColumn) WithImageOptions(imageBackgroundColor string) *CarouselColumn

WithImageOptions method, CarouselColumn can set imageBackgroundColor

type CarouselContainer added in v1.2.0

type CarouselContainer struct {
	Type     FlexContainerType
	Contents []*BubbleContainer
}

CarouselContainer type

func (*CarouselContainer) FlexContainer added in v1.2.0

func (*CarouselContainer) FlexContainer()

FlexContainer implements FlexContainer interface

func (*CarouselContainer) MarshalJSON

func (c *CarouselContainer) MarshalJSON() ([]byte, error)

MarshalJSON method of CarouselContainer

type CarouselTemplate

type CarouselTemplate struct {
	Columns          []*CarouselColumn
	ImageAspectRatio ImageAspectRatioType
	ImageSize        ImageSizeType
}

CarouselTemplate type

func NewCarouselTemplate

func NewCarouselTemplate(columns ...*CarouselColumn) *CarouselTemplate

NewCarouselTemplate function

func (*CarouselTemplate) MarshalJSON

func (t *CarouselTemplate) MarshalJSON() ([]byte, error)

MarshalJSON method of CarouselTemplate

func (*CarouselTemplate) Template added in v1.1.0

func (*CarouselTemplate) Template()

Template implements Template interface

func (*CarouselTemplate) WithImageOptions added in v1.1.0

func (t *CarouselTemplate) WithImageOptions(imageAspectRatio ImageAspectRatioType, imageSize ImageSizeType) *CarouselTemplate

WithImageOptions method, CarouselTemplate can set imageAspectRatio and imageSize

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client type

func New

func New(channelSecret, channelToken string, options ...ClientOption) (*Client, error)

New returns a new bot client instance.

func (*Client) AddLIFF added in v1.2.1

func (client *Client) AddLIFF(view View) *AddLIFFCall

AddLIFF method

func (*Client) CancelDefaultRichMenu

func (client *Client) CancelDefaultRichMenu() *CancelDefaultRichMenuCall

CancelDefaultRichMenu method

func (*Client) CreateRichMenu added in v1.1.0

func (client *Client) CreateRichMenu(richMenu RichMenu) *CreateRichMenuCall

CreateRichMenu method

func (*Client) DeleteLIFF added in v1.2.1

func (client *Client) DeleteLIFF(liffID string) *DeleteLIFFCall

DeleteLIFF method

func (*Client) DeleteRichMenu added in v1.1.0

func (client *Client) DeleteRichMenu(richMenuID string) *DeleteRichMenuCall

DeleteRichMenu method

func (*Client) DownloadRichMenuImage added in v1.1.0

func (client *Client) DownloadRichMenuImage(richMenuID string) *DownloadRichMenuImageCall

DownloadRichMenuImage method

func (*Client) GetDefaultRichMenu

func (client *Client) GetDefaultRichMenu() *GetDefaultRichMenuCall

GetDefaultRichMenu method

func (*Client) GetGroupMemberIDs added in v1.1.0

func (client *Client) GetGroupMemberIDs(groupID, continuationToken string) *GetGroupMemberIDsCall

GetGroupMemberIDs method

func (*Client) GetGroupMemberProfile added in v1.1.0

func (client *Client) GetGroupMemberProfile(groupID, userID string) *GetGroupMemberProfileCall

GetGroupMemberProfile method

func (*Client) GetLIFF added in v1.2.1

func (client *Client) GetLIFF() *GetLIFFAllCall

GetLIFF method

func (*Client) GetMessageContent

func (client *Client) GetMessageContent(messageID string) *GetMessageContentCall

GetMessageContent method

func (*Client) GetProfile

func (client *Client) GetProfile(userID string) *GetProfileCall

GetProfile method

func (*Client) GetRichMenu added in v1.1.0

func (client *Client) GetRichMenu(richMenuID string) *GetRichMenuCall

GetRichMenu method

func (*Client) GetRichMenuList added in v1.1.0

func (client *Client) GetRichMenuList() *GetRichMenuListCall

GetRichMenuList method

func (*Client) GetRoomMemberIDs added in v1.1.0

func (client *Client) GetRoomMemberIDs(roomID, continuationToken string) *GetRoomMemberIDsCall

GetRoomMemberIDs method

func (*Client) GetRoomMemberProfile added in v1.1.0

func (client *Client) GetRoomMemberProfile(roomID, userID string) *GetRoomMemberProfileCall

GetRoomMemberProfile method

func (*Client) GetUserRichMenu added in v1.1.0

func (client *Client) GetUserRichMenu(userID string) *GetUserRichMenuCall

GetUserRichMenu method

func (*Client) IssueLinkToken added in v1.3.0

func (client *Client) IssueLinkToken(userID string) *IssueLinkTokenCall

IssueLinkToken method https://developers.line.me/en/reference/messaging-api/#issue-link-token

func (*Client) LeaveGroup

func (client *Client) LeaveGroup(groupID string) *LeaveGroupCall

LeaveGroup method

func (*Client) LeaveRoom

func (client *Client) LeaveRoom(roomID string) *LeaveRoomCall

LeaveRoom method

func (*Client) LinkUserRichMenu added in v1.1.0

func (client *Client) LinkUserRichMenu(userID, richMenuID string) *LinkUserRichMenuCall

LinkUserRichMenu method

func (*Client) Multicast added in v1.1.0

func (client *Client) Multicast(to []string, messages ...SendingMessage) *MulticastCall

Multicast method

func (*Client) ParseRequest

func (client *Client) ParseRequest(r *http.Request) ([]*Event, error)

ParseRequest method

func (*Client) PushMessage

func (client *Client) PushMessage(to string, messages ...SendingMessage) *PushMessageCall

PushMessage method

func (*Client) ReplyMessage

func (client *Client) ReplyMessage(replyToken string, messages ...SendingMessage) *ReplyMessageCall

ReplyMessage method

func (*Client) SetDefaultRichMenu

func (client *Client) SetDefaultRichMenu(richMenuID string) *SetDefaultRichMenuCall

SetDefaultRichMenu method

func (*Client) UnlinkUserRichMenu added in v1.1.0

func (client *Client) UnlinkUserRichMenu(userID string) *UnlinkUserRichMenuCall

UnlinkUserRichMenu method

func (*Client) UpdateLIFF added in v1.2.1

func (client *Client) UpdateLIFF(liffID string, view View) *UpdateLIFFCall

UpdateLIFF method

func (*Client) UploadRichMenuImage added in v1.1.0

func (client *Client) UploadRichMenuImage(richMenuID, imgPath string) *UploadRichMenuImageCall

UploadRichMenuImage method

type ClientOption

type ClientOption func(*Client) error

ClientOption type

func WithEndpointBase

func WithEndpointBase(endpointBase string) ClientOption

WithEndpointBase function

func WithHTTPClient

func WithHTTPClient(c *http.Client) ClientOption

WithHTTPClient function

type ConfirmTemplate

type ConfirmTemplate struct {
	Text    string
	Actions []TemplateAction
}

ConfirmTemplate type

func NewConfirmTemplate

func NewConfirmTemplate(text string, left, right TemplateAction) *ConfirmTemplate

NewConfirmTemplate function

func (*ConfirmTemplate) MarshalJSON

func (t *ConfirmTemplate) MarshalJSON() ([]byte, error)

MarshalJSON method of ConfirmTemplate

func (*ConfirmTemplate) Template added in v1.1.0

func (*ConfirmTemplate) Template()

Template implements Template interface

type CreateRichMenuCall added in v1.1.0

type CreateRichMenuCall struct {
	// contains filtered or unexported fields
}

CreateRichMenuCall type

func (*CreateRichMenuCall) Do added in v1.1.0

Do method

func (*CreateRichMenuCall) WithContext added in v1.1.0

func (call *CreateRichMenuCall) WithContext(ctx context.Context) *CreateRichMenuCall

WithContext method

type DatetimePickerAction

type DatetimePickerAction struct {
	Label   string
	Data    string
	Mode    string
	Initial string
	Max     string
	Min     string
}

DatetimePickerAction type

func NewDatetimePickerAction

func NewDatetimePickerAction(label, data, mode, initial, max, min string) *DatetimePickerAction

NewDatetimePickerAction function

func (*DatetimePickerAction) MarshalJSON

func (a *DatetimePickerAction) MarshalJSON() ([]byte, error)

MarshalJSON method of DatetimePickerAction

func (*DatetimePickerAction) QuickReplyAction

func (*DatetimePickerAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

func (*DatetimePickerAction) TemplateAction

func (*DatetimePickerAction) TemplateAction()

TemplateAction implements TemplateAction interface

type DeleteLIFFCall added in v1.2.1

type DeleteLIFFCall struct {
	// contains filtered or unexported fields
}

DeleteLIFFCall type

func (*DeleteLIFFCall) Do added in v1.2.1

func (call *DeleteLIFFCall) Do() (*BasicResponse, error)

Do method

func (*DeleteLIFFCall) WithContext added in v1.2.1

func (call *DeleteLIFFCall) WithContext(ctx context.Context) *DeleteLIFFCall

WithContext method

type DeleteRichMenuCall added in v1.1.0

type DeleteRichMenuCall struct {
	// contains filtered or unexported fields
}

DeleteRichMenuCall type

func (*DeleteRichMenuCall) Do added in v1.1.0

func (call *DeleteRichMenuCall) Do() (*BasicResponse, error)

Do method

func (*DeleteRichMenuCall) WithContext added in v1.1.0

func (call *DeleteRichMenuCall) WithContext(ctx context.Context) *DeleteRichMenuCall

WithContext method

type DownloadRichMenuImageCall added in v1.1.0

type DownloadRichMenuImageCall struct {
	// contains filtered or unexported fields
}

DownloadRichMenuImageCall type

func (*DownloadRichMenuImageCall) Do added in v1.1.0

Do method

func (*DownloadRichMenuImageCall) WithContext added in v1.1.0

WithContext method

type ErrorResponse

type ErrorResponse struct {
	Message string                `json:"message"`
	Details []errorResponseDetail `json:"details"`
}

ErrorResponse type

type Event

type Event struct {
	ReplyToken  string
	Type        EventType
	Timestamp   time.Time
	Source      *EventSource
	Message     Message
	Joined      *Members `json:"joined"`
	Left        *Members `json:"left"`
	Postback    *Postback
	Beacon      *Beacon
	AccountLink *AccountLink
	Things      *Things `json:"things"`
	Members     []*EventSource
}

Event type

func ParseRequest added in v1.1.0

func ParseRequest(channelSecret string, r *http.Request) ([]*Event, error)

ParseRequest func

func (*Event) MarshalJSON added in v1.1.0

func (e *Event) MarshalJSON() ([]byte, error)

MarshalJSON method of Event

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(body []byte) (err error)

UnmarshalJSON method of Event

type EventSource

type EventSource struct {
	Type    EventSourceType `json:"type"`
	UserID  string          `json:"userId,omitempty"`
	GroupID string          `json:"groupId,omitempty"`
	RoomID  string          `json:"roomId,omitempty"`
}

EventSource type

type EventSourceType

type EventSourceType string

EventSourceType type

const (
	EventSourceTypeUser  EventSourceType = "user"
	EventSourceTypeGroup EventSourceType = "group"
	EventSourceTypeRoom  EventSourceType = "room"
)

EventSourceType constants

type EventType

type EventType string

EventType type

const (
	EventTypeMessage      EventType = "message"
	EventTypeFollow       EventType = "follow"
	EventTypeUnfollow     EventType = "unfollow"
	EventTypeJoin         EventType = "join"
	EventTypeLeave        EventType = "leave"
	EventTypeMemberJoined EventType = "memberJoined"
	EventTypeMemberLeft   EventType = "memberLeft"
	EventTypePostback     EventType = "postback"
	EventTypeBeacon       EventType = "beacon"
	EventTypeAccountLink  EventType = "accountLink"
	EventTypeThings       EventType = "things"
)

EventType constants

type FileMessage added in v1.2.0

type FileMessage struct {
	ID       string
	FileName string
	FileSize int
}

FileMessage type

func (*FileMessage) Message added in v1.2.0

func (*FileMessage) Message()

Message implements Message interface

type FillerComponent added in v1.2.0

type FillerComponent struct {
	Type FlexComponentType
}

FillerComponent type

func (*FillerComponent) FlexComponent added in v1.2.0

func (*FillerComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*FillerComponent) MarshalJSON

func (c *FillerComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of FillerComponent

type FlexBoxLayoutType added in v1.2.0

type FlexBoxLayoutType string

FlexBoxLayoutType type

const (
	FlexBoxLayoutTypeHorizontal FlexBoxLayoutType = "horizontal"
	FlexBoxLayoutTypeVertical   FlexBoxLayoutType = "vertical"
	FlexBoxLayoutTypeBaseline   FlexBoxLayoutType = "baseline"
)

FlexBoxLayoutType constants

type FlexBubbleDirectionType added in v1.2.0

type FlexBubbleDirectionType string

FlexBubbleDirectionType type

const (
	FlexBubbleDirectionTypeLTR FlexBubbleDirectionType = "ltr"
	FlexBubbleDirectionTypeRTL FlexBubbleDirectionType = "rtl"
)

FlexBubbleDirectionType constants

type FlexButtonHeightType added in v1.2.0

type FlexButtonHeightType string

FlexButtonHeightType type

const (
	FlexButtonHeightTypeMd FlexButtonHeightType = "md"
	FlexButtonHeightTypeSm FlexButtonHeightType = "sm"
)

FlexButtonHeightType constants

type FlexButtonStyleType added in v1.2.0

type FlexButtonStyleType string

FlexButtonStyleType type

const (
	FlexButtonStyleTypeLink      FlexButtonStyleType = "link"
	FlexButtonStyleTypePrimary   FlexButtonStyleType = "primary"
	FlexButtonStyleTypeSecondary FlexButtonStyleType = "secondary"
)

FlexButtonStyleType constants

type FlexComponent added in v1.2.0

type FlexComponent interface {
	FlexComponent()
}

FlexComponent interface

type FlexComponentAlignType added in v1.2.0

type FlexComponentAlignType string

FlexComponentAlignType type

const (
	FlexComponentAlignTypeStart  FlexComponentAlignType = "start"
	FlexComponentAlignTypeEnd    FlexComponentAlignType = "end"
	FlexComponentAlignTypeCenter FlexComponentAlignType = "center"
)

FlexComponentAlignType constants

type FlexComponentGravityType added in v1.2.0

type FlexComponentGravityType string

FlexComponentGravityType type

const (
	FlexComponentGravityTypeTop    FlexComponentGravityType = "top"
	FlexComponentGravityTypeBottom FlexComponentGravityType = "bottom"
	FlexComponentGravityTypeCenter FlexComponentGravityType = "center"
)

FlexComponentGravityType constants

type FlexComponentMarginType added in v1.2.0

type FlexComponentMarginType string

FlexComponentMarginType type

const (
	FlexComponentMarginTypeNone FlexComponentMarginType = "none"
	FlexComponentMarginTypeXs   FlexComponentMarginType = "xs"
	FlexComponentMarginTypeSm   FlexComponentMarginType = "sm"
	FlexComponentMarginTypeMd   FlexComponentMarginType = "md"
	FlexComponentMarginTypeLg   FlexComponentMarginType = "lg"
	FlexComponentMarginTypeXl   FlexComponentMarginType = "xl"
	FlexComponentMarginTypeXxl  FlexComponentMarginType = "xxl"
)

FlexComponentMarginType constants

type FlexComponentSpacingType added in v1.2.0

type FlexComponentSpacingType string

FlexComponentSpacingType type

const (
	FlexComponentSpacingTypeNone FlexComponentSpacingType = "none"
	FlexComponentSpacingTypeXs   FlexComponentSpacingType = "xs"
	FlexComponentSpacingTypeSm   FlexComponentSpacingType = "sm"
	FlexComponentSpacingTypeMd   FlexComponentSpacingType = "md"
	FlexComponentSpacingTypeLg   FlexComponentSpacingType = "lg"
	FlexComponentSpacingTypeXl   FlexComponentSpacingType = "xl"
	FlexComponentSpacingTypeXxl  FlexComponentSpacingType = "xxl"
)

FlexComponentSpacingType constants

type FlexComponentType added in v1.2.0

type FlexComponentType string

FlexComponentType type

const (
	FlexComponentTypeBox       FlexComponentType = "box"
	FlexComponentTypeButton    FlexComponentType = "button"
	FlexComponentTypeFiller    FlexComponentType = "filler"
	FlexComponentTypeIcon      FlexComponentType = "icon"
	FlexComponentTypeImage     FlexComponentType = "image"
	FlexComponentTypeSeparator FlexComponentType = "separator"
	FlexComponentTypeSpacer    FlexComponentType = "spacer"
	FlexComponentTypeText      FlexComponentType = "text"
)

FlexComponentType constants

type FlexContainer added in v1.2.0

type FlexContainer interface {
	FlexContainer()
}

FlexContainer interface

func UnmarshalFlexMessageJSON added in v1.2.0

func UnmarshalFlexMessageJSON(data []byte) (FlexContainer, error)

UnmarshalFlexMessageJSON function

Example
package main

import (
	"github.com/line/line-bot-sdk-go/linebot"
)

func main() {
	container, err := linebot.UnmarshalFlexMessageJSON([]byte(`{
    "type": "bubble",
    "body": {
      "type": "box",
      "layout": "vertical",
      "contents": [
        {
          "type": "text",
          "text": "hello"
        },
        {
          "type": "text",
          "text": "world"
        }
      ]
    }
  }`))
	if err != nil {
		panic(err)
	}

	linebot.NewFlexMessage("alt text", container)
}
Output:

type FlexContainerType added in v1.2.0

type FlexContainerType = string // alias type

FlexContainerType type

const (
	FlexContainerTypeBubble   FlexContainerType = "bubble"
	FlexContainerTypeCarousel FlexContainerType = "carousel"
)

FlexContainerType constants

type FlexIconAspectRatioType added in v1.2.0

type FlexIconAspectRatioType string

FlexIconAspectRatioType type

const (
	FlexIconAspectRatioType1to1 FlexIconAspectRatioType = "1:1"
	FlexIconAspectRatioType2to1 FlexIconAspectRatioType = "2:1"
	FlexIconAspectRatioType3to1 FlexIconAspectRatioType = "3:1"
)

FlexIconAspectRatioType constants

type FlexIconSizeType added in v1.2.0

type FlexIconSizeType string

FlexIconSizeType type

const (
	FlexIconSizeTypeXxs FlexIconSizeType = "xxs"
	FlexIconSizeTypeXs  FlexIconSizeType = "xs"
	FlexIconSizeTypeSm  FlexIconSizeType = "sm"
	FlexIconSizeTypeMd  FlexIconSizeType = "md"
	FlexIconSizeTypeLg  FlexIconSizeType = "lg"
	FlexIconSizeTypeXl  FlexIconSizeType = "xl"
	FlexIconSizeTypeXxl FlexIconSizeType = "xxl"
	FlexIconSizeType3xl FlexIconSizeType = "3xl"
	FlexIconSizeType4xl FlexIconSizeType = "4xl"
	FlexIconSizeType5xl FlexIconSizeType = "5xl"
)

FlexIconSizeType constants

type FlexImageAspectModeType added in v1.2.0

type FlexImageAspectModeType string

FlexImageAspectModeType type

const (
	FlexImageAspectModeTypeCover FlexImageAspectModeType = "cover"
	FlexImageAspectModeTypeFit   FlexImageAspectModeType = "fit"
)

FlexImageAspectModeType constants

type FlexImageAspectRatioType added in v1.2.0

type FlexImageAspectRatioType string

FlexImageAspectRatioType type

const (
	FlexImageAspectRatioType1to1    FlexImageAspectRatioType = "1:1"
	FlexImageAspectRatioType1_51to1 FlexImageAspectRatioType = "1.51:1"
	FlexImageAspectRatioType1_91to1 FlexImageAspectRatioType = "1.91:1"
	FlexImageAspectRatioType4to3    FlexImageAspectRatioType = "4:3"
	FlexImageAspectRatioType16to9   FlexImageAspectRatioType = "16:9"
	FlexImageAspectRatioType20to13  FlexImageAspectRatioType = "20:13"
	FlexImageAspectRatioType2to1    FlexImageAspectRatioType = "2:1"
	FlexImageAspectRatioType3to1    FlexImageAspectRatioType = "3:1"
	FlexImageAspectRatioType3to4    FlexImageAspectRatioType = "3:4"
	FlexImageAspectRatioType9to16   FlexImageAspectRatioType = "9:16"
	FlexImageAspectRatioType1to2    FlexImageAspectRatioType = "1:2"
	FlexImageAspectRatioType1to3    FlexImageAspectRatioType = "1:3"
)

FlexImageAspectRatioType constants

type FlexImageSizeType added in v1.2.0

type FlexImageSizeType string

FlexImageSizeType type

const (
	FlexImageSizeTypeXxs  FlexImageSizeType = "xxs"
	FlexImageSizeTypeXs   FlexImageSizeType = "xs"
	FlexImageSizeTypeSm   FlexImageSizeType = "sm"
	FlexImageSizeTypeMd   FlexImageSizeType = "md"
	FlexImageSizeTypeLg   FlexImageSizeType = "lg"
	FlexImageSizeTypeXl   FlexImageSizeType = "xl"
	FlexImageSizeTypeXxl  FlexImageSizeType = "xxl"
	FlexImageSizeType3xl  FlexImageSizeType = "3xl"
	FlexImageSizeType4xl  FlexImageSizeType = "4xl"
	FlexImageSizeType5xl  FlexImageSizeType = "5xl"
	FlexImageSizeTypeFull FlexImageSizeType = "full"
)

FlexImageSizeType constants

type FlexMessage added in v1.1.1

type FlexMessage struct {
	AltText  string
	Contents FlexContainer
	// contains filtered or unexported fields
}

FlexMessage type

func NewFlexMessage added in v1.1.1

func NewFlexMessage(altText string, contents FlexContainer) *FlexMessage

NewFlexMessage function

func (*FlexMessage) MarshalJSON added in v1.1.1

func (m *FlexMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of FlexMessage

func (*FlexMessage) Message added in v1.1.1

func (*FlexMessage) Message()

Message implements Message interface

func (*FlexMessage) WithQuickReplies

func (m *FlexMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of FlexMessage

type FlexSpacerSizeType added in v1.2.0

type FlexSpacerSizeType string

FlexSpacerSizeType type

const (
	FlexSpacerSizeTypeXs  FlexSpacerSizeType = "xs"
	FlexSpacerSizeTypeSm  FlexSpacerSizeType = "sm"
	FlexSpacerSizeTypeMd  FlexSpacerSizeType = "md"
	FlexSpacerSizeTypeLg  FlexSpacerSizeType = "lg"
	FlexSpacerSizeTypeXl  FlexSpacerSizeType = "xl"
	FlexSpacerSizeTypeXxl FlexSpacerSizeType = "xxl"
)

FlexSpacerSizeType constants

type FlexTextSizeType added in v1.2.0

type FlexTextSizeType string

FlexTextSizeType type

const (
	FlexTextSizeTypeXxs FlexTextSizeType = "xxs"
	FlexTextSizeTypeXs  FlexTextSizeType = "xs"
	FlexTextSizeTypeSm  FlexTextSizeType = "sm"
	FlexTextSizeTypeMd  FlexTextSizeType = "md"
	FlexTextSizeTypeLg  FlexTextSizeType = "lg"
	FlexTextSizeTypeXl  FlexTextSizeType = "xl"
	FlexTextSizeTypeXxl FlexTextSizeType = "xxl"
	FlexTextSizeType3xl FlexTextSizeType = "3xl"
	FlexTextSizeType4xl FlexTextSizeType = "4xl"
	FlexTextSizeType5xl FlexTextSizeType = "5xl"
)

FlexTextSizeType constants

type FlexTextWeightType added in v1.2.0

type FlexTextWeightType string

FlexTextWeightType type

const (
	FlexTextWeightTypeRegular FlexTextWeightType = "regular"
	FlexTextWeightTypeBold    FlexTextWeightType = "bold"
)

FlexTextWeightType constants

type GetDefaultRichMenuCall

type GetDefaultRichMenuCall struct {
	// contains filtered or unexported fields
}

GetDefaultRichMenuCall type

func (*GetDefaultRichMenuCall) Do

Do method

func (*GetDefaultRichMenuCall) WithContext

WithContext method

type GetGroupMemberIDsCall added in v1.1.0

type GetGroupMemberIDsCall struct {
	// contains filtered or unexported fields
}

GetGroupMemberIDsCall type

func (*GetGroupMemberIDsCall) Do added in v1.1.0

Do method

func (*GetGroupMemberIDsCall) NewScanner added in v1.1.0

func (call *GetGroupMemberIDsCall) NewScanner() *IDsScanner

NewScanner returns Group IDs scanner.

func (*GetGroupMemberIDsCall) WithContext added in v1.1.0

WithContext method

type GetGroupMemberProfileCall added in v1.1.0

type GetGroupMemberProfileCall struct {
	// contains filtered or unexported fields
}

GetGroupMemberProfileCall type

func (*GetGroupMemberProfileCall) Do added in v1.1.0

Do method

func (*GetGroupMemberProfileCall) WithContext added in v1.1.0

WithContext method

type GetLIFFAllCall added in v1.2.1

type GetLIFFAllCall struct {
	// contains filtered or unexported fields
}

GetLIFFAllCall type

func (*GetLIFFAllCall) Do added in v1.2.1

func (call *GetLIFFAllCall) Do() (*LIFFAppsResponse, error)

Do method

func (*GetLIFFAllCall) WithContext added in v1.2.1

func (call *GetLIFFAllCall) WithContext(ctx context.Context) *GetLIFFAllCall

WithContext method

type GetMessageContentCall

type GetMessageContentCall struct {
	// contains filtered or unexported fields
}

GetMessageContentCall type

func (*GetMessageContentCall) Do

Do method

func (*GetMessageContentCall) WithContext

WithContext method

type GetProfileCall

type GetProfileCall struct {
	// contains filtered or unexported fields
}

GetProfileCall type

func (*GetProfileCall) Do

func (call *GetProfileCall) Do() (*UserProfileResponse, error)

Do method

func (*GetProfileCall) WithContext

func (call *GetProfileCall) WithContext(ctx context.Context) *GetProfileCall

WithContext method

type GetRichMenuCall added in v1.1.0

type GetRichMenuCall struct {
	// contains filtered or unexported fields
}

GetRichMenuCall type

func (*GetRichMenuCall) Do added in v1.1.0

func (call *GetRichMenuCall) Do() (*RichMenuResponse, error)

Do method

func (*GetRichMenuCall) WithContext added in v1.1.0

func (call *GetRichMenuCall) WithContext(ctx context.Context) *GetRichMenuCall

WithContext method

type GetRichMenuListCall added in v1.1.0

type GetRichMenuListCall struct {
	// contains filtered or unexported fields
}

GetRichMenuListCall type

func (*GetRichMenuListCall) Do added in v1.1.0

func (call *GetRichMenuListCall) Do() ([]*RichMenuResponse, error)

Do method

func (*GetRichMenuListCall) WithContext added in v1.1.0

func (call *GetRichMenuListCall) WithContext(ctx context.Context) *GetRichMenuListCall

WithContext method

type GetRoomMemberIDsCall added in v1.1.0

type GetRoomMemberIDsCall struct {
	// contains filtered or unexported fields
}

GetRoomMemberIDsCall type

func (*GetRoomMemberIDsCall) Do added in v1.1.0

Do method

func (*GetRoomMemberIDsCall) NewScanner added in v1.1.0

func (call *GetRoomMemberIDsCall) NewScanner() *IDsScanner

NewScanner returns Room IDs scanner.

func (*GetRoomMemberIDsCall) WithContext added in v1.1.0

func (call *GetRoomMemberIDsCall) WithContext(ctx context.Context) *GetRoomMemberIDsCall

WithContext method

type GetRoomMemberProfileCall added in v1.1.0

type GetRoomMemberProfileCall struct {
	// contains filtered or unexported fields
}

GetRoomMemberProfileCall type

func (*GetRoomMemberProfileCall) Do added in v1.1.0

Do method

func (*GetRoomMemberProfileCall) WithContext added in v1.1.0

WithContext method

type GetUserRichMenuCall added in v1.1.0

type GetUserRichMenuCall struct {
	// contains filtered or unexported fields
}

GetUserRichMenuCall type

func (*GetUserRichMenuCall) Do added in v1.1.0

Do method

func (*GetUserRichMenuCall) WithContext added in v1.1.0

func (call *GetUserRichMenuCall) WithContext(ctx context.Context) *GetUserRichMenuCall

WithContext method

type IDsScanner added in v1.1.0

type IDsScanner struct {
	// contains filtered or unexported fields
}

IDsScanner type

Example
package main

import (
	"fmt"
	"os"

	"github.com/line/line-bot-sdk-go/linebot"
)

func main() {
	bot, err := linebot.New("secret", "token")
	if err != nil {
		fmt.Fprintln(os.Stderr, "linebot.New:", err)
	}
	s := bot.GetGroupMemberIDs("cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "").NewScanner()
	for s.Scan() {
		fmt.Fprintln(os.Stdout, s.ID())
	}
	if err := s.Err(); err != nil {
		fmt.Fprintln(os.Stderr, "GetGroupMemberIDs:", err)
	}
}
Output:

func (*IDsScanner) Err added in v1.1.0

func (s *IDsScanner) Err() error

Err returns scan error.

func (*IDsScanner) ID added in v1.1.0

func (s *IDsScanner) ID() string

ID returns member id.

func (*IDsScanner) Scan added in v1.1.0

func (s *IDsScanner) Scan() bool

Scan method

type IconComponent added in v1.2.0

type IconComponent struct {
	Type        FlexComponentType
	URL         string
	Margin      FlexComponentMarginType
	Size        FlexIconSizeType
	AspectRatio FlexIconAspectRatioType
}

IconComponent type

func (*IconComponent) FlexComponent added in v1.2.0

func (*IconComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*IconComponent) MarshalJSON

func (c *IconComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of IconComponent

type ImageAspectRatioType added in v1.1.0

type ImageAspectRatioType string

ImageAspectRatioType type

const (
	ImageAspectRatioTypeRectangle ImageAspectRatioType = "rectangle"
	ImageAspectRatioTypeSquare    ImageAspectRatioType = "square"
)

ImageAspectRatioType constants

type ImageCarouselColumn added in v1.1.0

type ImageCarouselColumn struct {
	ImageURL string         `json:"imageUrl"`
	Action   TemplateAction `json:"action"`
}

ImageCarouselColumn type

func NewImageCarouselColumn added in v1.1.0

func NewImageCarouselColumn(imageURL string, action TemplateAction) *ImageCarouselColumn

NewImageCarouselColumn function

type ImageCarouselTemplate added in v1.1.0

type ImageCarouselTemplate struct {
	Columns []*ImageCarouselColumn
}

ImageCarouselTemplate type

func NewImageCarouselTemplate added in v1.1.0

func NewImageCarouselTemplate(columns ...*ImageCarouselColumn) *ImageCarouselTemplate

NewImageCarouselTemplate function

func (*ImageCarouselTemplate) MarshalJSON added in v1.1.0

func (t *ImageCarouselTemplate) MarshalJSON() ([]byte, error)

MarshalJSON method of ImageCarouselTemplate

func (*ImageCarouselTemplate) Template added in v1.1.0

func (*ImageCarouselTemplate) Template()

Template implements Template interface

type ImageComponent added in v1.2.0

type ImageComponent struct {
	Type            FlexComponentType
	URL             string
	Flex            *int
	Margin          FlexComponentMarginType
	Align           FlexComponentAlignType
	Gravity         FlexComponentGravityType
	Size            FlexImageSizeType
	AspectRatio     FlexImageAspectRatioType
	AspectMode      FlexImageAspectModeType
	BackgroundColor string
	Action          TemplateAction
}

ImageComponent type

func (*ImageComponent) FlexComponent added in v1.2.0

func (*ImageComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*ImageComponent) MarshalJSON

func (c *ImageComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of ImageComponent

func (*ImageComponent) UnmarshalJSON added in v1.2.0

func (c *ImageComponent) UnmarshalJSON(data []byte) error

UnmarshalJSON method for ImageComponent

type ImageMessage

type ImageMessage struct {
	ID                 string
	OriginalContentURL string
	PreviewImageURL    string
	// contains filtered or unexported fields
}

ImageMessage type

func NewImageMessage

func NewImageMessage(originalContentURL, previewImageURL string) *ImageMessage

NewImageMessage function

func (*ImageMessage) MarshalJSON

func (m *ImageMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of ImageMessage

func (*ImageMessage) Message added in v1.1.0

func (*ImageMessage) Message()

Message implements Message interface

func (*ImageMessage) WithQuickReplies

func (m *ImageMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of ImageMessage

type ImageSizeType added in v1.1.0

type ImageSizeType string

ImageSizeType type

const (
	ImageSizeTypeCover   ImageSizeType = "cover"
	ImageSizeTypeContain ImageSizeType = "contain"
)

ImageSizeType constants

type ImagemapAction

type ImagemapAction interface {
	json.Marshaler
	ImagemapAction()
}

ImagemapAction type

type ImagemapActionType

type ImagemapActionType string

ImagemapActionType type

const (
	ImagemapActionTypeURI     ImagemapActionType = "uri"
	ImagemapActionTypeMessage ImagemapActionType = "message"
)

ImagemapActionType constants

type ImagemapArea

type ImagemapArea struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

ImagemapArea type

type ImagemapBaseSize

type ImagemapBaseSize struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

ImagemapBaseSize type

type ImagemapMessage

type ImagemapMessage struct {
	BaseURL  string
	AltText  string
	BaseSize ImagemapBaseSize
	Actions  []ImagemapAction
	Video    *ImagemapVideo
	// contains filtered or unexported fields
}

ImagemapMessage type

func NewImagemapMessage

func NewImagemapMessage(baseURL, altText string, baseSize ImagemapBaseSize, actions ...ImagemapAction) *ImagemapMessage

NewImagemapMessage function

func (*ImagemapMessage) MarshalJSON

func (m *ImagemapMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of ImagemapMessage

func (*ImagemapMessage) Message added in v1.1.0

func (*ImagemapMessage) Message()

Message implements Message interface

func (*ImagemapMessage) WithQuickReplies

func (m *ImagemapMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of ImagemapMessage

func (*ImagemapMessage) WithVideo

func (m *ImagemapMessage) WithVideo(video *ImagemapVideo) *ImagemapMessage

WithVideo method

type ImagemapVideo

type ImagemapVideo struct {
	OriginalContentURL string                     `json:"originalContentUrl"`
	PreviewImageURL    string                     `json:"previewImageUrl"`
	Area               ImagemapArea               `json:"area"`
	ExternalLink       *ImagemapVideoExternalLink `json:"externalLink,omitempty"`
}

ImagemapVideo type

type ImagemapVideoExternalLink struct {
	LinkURI string `json:"linkUri"`
	Label   string `json:"label"`
}

ImagemapVideoExternalLink type

type IssueLinkTokenCall added in v1.3.0

type IssueLinkTokenCall struct {
	// contains filtered or unexported fields
}

IssueLinkTokenCall type

func (*IssueLinkTokenCall) Do added in v1.3.0

Do method

func (*IssueLinkTokenCall) WithContext added in v1.3.0

func (call *IssueLinkTokenCall) WithContext(ctx context.Context) *IssueLinkTokenCall

WithContext method

type LIFFApp

type LIFFApp struct {
	LIFFID string `json:"liffId"`
	View   View   `json:"view"`
}

LIFFApp type

type LIFFAppsResponse

type LIFFAppsResponse struct {
	Apps []LIFFApp `json:"apps"`
}

LIFFAppsResponse type

type LIFFIDResponse added in v1.2.1

type LIFFIDResponse struct {
	LIFFID string `json:"liffId"`
}

LIFFIDResponse type

type LIFFViewType added in v1.2.1

type LIFFViewType string

LIFFViewType type

const (
	LIFFViewTypeCompact LIFFViewType = "compact"
	LIFFViewTypeTall    LIFFViewType = "tall"
	LIFFViewTypeFull    LIFFViewType = "full"
)

LIFFViewType constants

type LeaveGroupCall

type LeaveGroupCall struct {
	// contains filtered or unexported fields
}

LeaveGroupCall type

func (*LeaveGroupCall) Do

func (call *LeaveGroupCall) Do() (*BasicResponse, error)

Do method

func (*LeaveGroupCall) WithContext

func (call *LeaveGroupCall) WithContext(ctx context.Context) *LeaveGroupCall

WithContext method

type LeaveRoomCall

type LeaveRoomCall struct {
	// contains filtered or unexported fields
}

LeaveRoomCall type

func (*LeaveRoomCall) Do

func (call *LeaveRoomCall) Do() (*BasicResponse, error)

Do method

func (*LeaveRoomCall) WithContext

func (call *LeaveRoomCall) WithContext(ctx context.Context) *LeaveRoomCall

WithContext method

type LinkTokenResponse added in v1.3.0

type LinkTokenResponse struct {
	LinkToken string `json:"linkToken"`
}

LinkTokenResponse type

type LinkUserRichMenuCall added in v1.1.0

type LinkUserRichMenuCall struct {
	// contains filtered or unexported fields
}

LinkUserRichMenuCall type

func (*LinkUserRichMenuCall) Do added in v1.1.0

func (call *LinkUserRichMenuCall) Do() (*BasicResponse, error)

Do method

func (*LinkUserRichMenuCall) WithContext added in v1.1.0

func (call *LinkUserRichMenuCall) WithContext(ctx context.Context) *LinkUserRichMenuCall

WithContext method

type LocationAction

type LocationAction struct {
	Label string
}

LocationAction type

func NewLocationAction

func NewLocationAction(label string) *LocationAction

NewLocationAction function

func (*LocationAction) MarshalJSON

func (a *LocationAction) MarshalJSON() ([]byte, error)

MarshalJSON method of LocationAction

func (*LocationAction) QuickReplyAction

func (*LocationAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

type LocationMessage

type LocationMessage struct {
	ID        string
	Title     string
	Address   string
	Latitude  float64
	Longitude float64
	// contains filtered or unexported fields
}

LocationMessage type

func NewLocationMessage

func NewLocationMessage(title, address string, latitude, longitude float64) *LocationMessage

NewLocationMessage function

func (*LocationMessage) MarshalJSON

func (m *LocationMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of LocationMessage

func (*LocationMessage) Message added in v1.1.0

func (*LocationMessage) Message()

Message implements Message interface

func (*LocationMessage) WithQuickReplies

func (m *LocationMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of LocationMessage

type MemberIDsResponse added in v1.1.0

type MemberIDsResponse struct {
	MemberIDs []string `json:"memberIds"`
	Next      string   `json:"next"`
}

MemberIDsResponse type

type Members

type Members struct {
	Members []EventSource `json:"members"`
}

Members type

type Message

type Message interface {
	Message()
}

Message interface

type MessageAction

type MessageAction struct {
	Label string
	Text  string
}

MessageAction type

func NewMessageAction

func NewMessageAction(label, text string) *MessageAction

NewMessageAction function

func (*MessageAction) MarshalJSON

func (a *MessageAction) MarshalJSON() ([]byte, error)

MarshalJSON method of MessageAction

func (*MessageAction) QuickReplyAction

func (*MessageAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

func (*MessageAction) TemplateAction

func (*MessageAction) TemplateAction()

TemplateAction implements TemplateAction interface

type MessageContentResponse

type MessageContentResponse struct {
	Content       io.ReadCloser
	ContentLength int64
	ContentType   string
}

MessageContentResponse type

type MessageImagemapAction

type MessageImagemapAction struct {
	Text string
	Area ImagemapArea
}

MessageImagemapAction type

func NewMessageImagemapAction

func NewMessageImagemapAction(text string, area ImagemapArea) *MessageImagemapAction

NewMessageImagemapAction function

func (*MessageImagemapAction) ImagemapAction added in v1.1.0

func (a *MessageImagemapAction) ImagemapAction()

ImagemapAction implements ImagemapAction interface

func (*MessageImagemapAction) MarshalJSON

func (a *MessageImagemapAction) MarshalJSON() ([]byte, error)

MarshalJSON method of MessageImagemapAction

type MessageType

type MessageType string

MessageType type

const (
	MessageTypeText     MessageType = "text"
	MessageTypeImage    MessageType = "image"
	MessageTypeVideo    MessageType = "video"
	MessageTypeAudio    MessageType = "audio"
	MessageTypeFile     MessageType = "file"
	MessageTypeLocation MessageType = "location"
	MessageTypeSticker  MessageType = "sticker"
	MessageTypeTemplate MessageType = "template"
	MessageTypeImagemap MessageType = "imagemap"
	MessageTypeFlex     MessageType = "flex"
)

MessageType constants

type MulticastCall added in v1.1.0

type MulticastCall struct {
	// contains filtered or unexported fields
}

MulticastCall type

func (*MulticastCall) Do added in v1.1.0

func (call *MulticastCall) Do() (*BasicResponse, error)

Do method

func (*MulticastCall) WithContext added in v1.1.0

func (call *MulticastCall) WithContext(ctx context.Context) *MulticastCall

WithContext method

type Params added in v1.1.0

type Params struct {
	Date     string `json:"date,omitempty"`
	Time     string `json:"time,omitempty"`
	Datetime string `json:"datetime,omitempty"`
}

Params type

type Postback

type Postback struct {
	Data   string  `json:"data"`
	Params *Params `json:"params,omitempty"`
}

Postback type

type PostbackAction

type PostbackAction struct {
	Label       string
	Data        string
	Text        string
	DisplayText string
}

PostbackAction type

func NewPostbackAction

func NewPostbackAction(label, data, text, displayText string) *PostbackAction

NewPostbackAction function

func (*PostbackAction) MarshalJSON

func (a *PostbackAction) MarshalJSON() ([]byte, error)

MarshalJSON method of PostbackAction

func (*PostbackAction) QuickReplyAction

func (*PostbackAction) QuickReplyAction()

QuickReplyAction implements QuickReplyAction interface

func (*PostbackAction) TemplateAction

func (*PostbackAction) TemplateAction()

TemplateAction implements TemplateAction interface

type PushMessageCall

type PushMessageCall struct {
	// contains filtered or unexported fields
}

PushMessageCall type

func (*PushMessageCall) Do

func (call *PushMessageCall) Do() (*BasicResponse, error)

Do method

func (*PushMessageCall) WithContext

func (call *PushMessageCall) WithContext(ctx context.Context) *PushMessageCall

WithContext method

type QuickReplyAction

type QuickReplyAction interface {
	Action
	QuickReplyAction()
}

QuickReplyAction type

type QuickReplyButton

type QuickReplyButton struct {
	ImageURL string
	Action   QuickReplyAction
}

QuickReplyButton type

func NewQuickReplyButton

func NewQuickReplyButton(imageURL string, action QuickReplyAction) *QuickReplyButton

NewQuickReplyButton function

func (*QuickReplyButton) MarshalJSON

func (b *QuickReplyButton) MarshalJSON() ([]byte, error)

MarshalJSON method of QuickReplyButton

type QuickReplyItems

type QuickReplyItems struct {
	Items []*QuickReplyButton `json:"items"`
}

QuickReplyItems struct

func NewQuickReplyItems

func NewQuickReplyItems(buttons ...*QuickReplyButton) *QuickReplyItems

NewQuickReplyItems function

type ReplyMessageCall

type ReplyMessageCall struct {
	// contains filtered or unexported fields
}

ReplyMessageCall type

func (*ReplyMessageCall) Do

func (call *ReplyMessageCall) Do() (*BasicResponse, error)

Do method

func (*ReplyMessageCall) WithContext

func (call *ReplyMessageCall) WithContext(ctx context.Context) *ReplyMessageCall

WithContext method

type RichMenu added in v1.1.0

type RichMenu struct {
	Size        RichMenuSize
	Selected    bool
	Name        string
	ChatBarText string
	Areas       []AreaDetail
}

RichMenu type

type RichMenuAction added in v1.1.0

type RichMenuAction struct {
	Type    RichMenuActionType `json:"type"`
	URI     string             `json:"uri,omitempty"`
	Text    string             `json:"text,omitempty"`
	Data    string             `json:"data,omitempty"`
	Mode    string             `json:"mode,omitempty"`
	Initial string             `json:"initial,omitempty"`
	Max     string             `json:"max,omitempty"`
	Min     string             `json:"min,omitempty"`
}

RichMenuAction with type

type RichMenuActionType added in v1.1.0

type RichMenuActionType string

RichMenuActionType type

const (
	RichMenuActionTypeURI            RichMenuActionType = "uri"
	RichMenuActionTypeMessage        RichMenuActionType = "message"
	RichMenuActionTypePostback       RichMenuActionType = "postback"
	RichMenuActionTypeDatetimePicker RichMenuActionType = "datetimepicker"
)

RichMenuActionType constants

type RichMenuBounds added in v1.1.0

type RichMenuBounds struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

RichMenuBounds type

type RichMenuIDResponse added in v1.1.0

type RichMenuIDResponse struct {
	RichMenuID string `json:"richMenuId"`
}

RichMenuIDResponse type

type RichMenuResponse added in v1.1.0

type RichMenuResponse struct {
	RichMenuID  string       `json:"richMenuId"`
	Size        RichMenuSize `json:"size"`
	Selected    bool         `json:"selected"`
	Name        string       `json:"name"`
	ChatBarText string       `json:"chatBarText"`
	Areas       []AreaDetail `json:"areas"`
}

RichMenuResponse type

type RichMenuSize added in v1.1.0

type RichMenuSize struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

RichMenuSize type

type SendingMessage

type SendingMessage interface {
	Message
	WithQuickReplies(*QuickReplyItems) SendingMessage
}

SendingMessage interface

type SeparatorComponent added in v1.2.0

type SeparatorComponent struct {
	Type   FlexComponentType
	Margin FlexComponentMarginType
	Color  string
}

SeparatorComponent type

func (*SeparatorComponent) FlexComponent added in v1.2.0

func (*SeparatorComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*SeparatorComponent) MarshalJSON

func (c *SeparatorComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of SeparatorComponent

type SetDefaultRichMenuCall

type SetDefaultRichMenuCall struct {
	// contains filtered or unexported fields
}

SetDefaultRichMenuCall type

func (*SetDefaultRichMenuCall) Do

Do method

func (*SetDefaultRichMenuCall) WithContext

WithContext method

type SpacerComponent added in v1.2.0

type SpacerComponent struct {
	Type FlexComponentType
	Size FlexSpacerSizeType
}

SpacerComponent type

func (*SpacerComponent) FlexComponent added in v1.2.0

func (*SpacerComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*SpacerComponent) MarshalJSON

func (c *SpacerComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of SpacerComponent

type StickerMessage

type StickerMessage struct {
	ID        string
	PackageID string
	StickerID string
	// contains filtered or unexported fields
}

StickerMessage type

func NewStickerMessage

func NewStickerMessage(packageID, stickerID string) *StickerMessage

NewStickerMessage function

func (*StickerMessage) MarshalJSON

func (m *StickerMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of StickerMessage

func (*StickerMessage) Message added in v1.1.0

func (*StickerMessage) Message()

Message implements Message interface

func (*StickerMessage) WithQuickReplies

func (m *StickerMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of StickerMessage

type Template

type Template interface {
	json.Marshaler
	Template()
}

Template interface

type TemplateAction

type TemplateAction interface {
	Action
	TemplateAction()
}

TemplateAction interface

type TemplateMessage

type TemplateMessage struct {
	AltText  string
	Template Template
	// contains filtered or unexported fields
}

TemplateMessage type

func NewTemplateMessage

func NewTemplateMessage(altText string, template Template) *TemplateMessage

NewTemplateMessage function

func (*TemplateMessage) MarshalJSON

func (m *TemplateMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of TemplateMessage

func (*TemplateMessage) Message added in v1.1.0

func (*TemplateMessage) Message()

Message implements Message interface

func (*TemplateMessage) WithQuickReplies

func (m *TemplateMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of TemplateMessage

type TemplateType

type TemplateType string

TemplateType type

const (
	TemplateTypeButtons       TemplateType = "buttons"
	TemplateTypeConfirm       TemplateType = "confirm"
	TemplateTypeCarousel      TemplateType = "carousel"
	TemplateTypeImageCarousel TemplateType = "image_carousel"
)

TemplateType constants

type TextComponent added in v1.2.0

type TextComponent struct {
	Type    FlexComponentType
	Text    string
	Flex    *int
	Margin  FlexComponentMarginType
	Size    FlexTextSizeType
	Align   FlexComponentAlignType
	Gravity FlexComponentGravityType
	Wrap    bool
	Weight  FlexTextWeightType
	Color   string
	Action  TemplateAction
}

TextComponent type

func (*TextComponent) FlexComponent added in v1.2.0

func (*TextComponent) FlexComponent()

FlexComponent implements FlexComponent interface

func (*TextComponent) MarshalJSON

func (c *TextComponent) MarshalJSON() ([]byte, error)

MarshalJSON method of TextComponent

func (*TextComponent) UnmarshalJSON added in v1.2.0

func (c *TextComponent) UnmarshalJSON(data []byte) error

UnmarshalJSON method for TextComponent

type TextMessage

type TextMessage struct {
	ID   string
	Text string
	// contains filtered or unexported fields
}

TextMessage type

func NewTextMessage

func NewTextMessage(content string) *TextMessage

NewTextMessage function

func (*TextMessage) MarshalJSON

func (m *TextMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of TextMessage

func (*TextMessage) Message added in v1.1.0

func (*TextMessage) Message()

Message implements Message interface

func (*TextMessage) WithQuickReplies

func (m *TextMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of TextMessage

type Things

type Things struct {
	DeviceID string `json:"deviceId"`
	Type     string `json:"type"`
}

Things type

type URIAction

type URIAction struct {
	Label string
	URI   string
}

URIAction type

func NewURIAction

func NewURIAction(label, uri string) *URIAction

NewURIAction function

func (*URIAction) MarshalJSON

func (a *URIAction) MarshalJSON() ([]byte, error)

MarshalJSON method of URIAction

func (*URIAction) TemplateAction

func (*URIAction) TemplateAction()

TemplateAction implements TemplateAction interface

type URIImagemapAction

type URIImagemapAction struct {
	LinkURL string
	Area    ImagemapArea
}

URIImagemapAction type

func NewURIImagemapAction

func NewURIImagemapAction(linkURL string, area ImagemapArea) *URIImagemapAction

NewURIImagemapAction function

func (*URIImagemapAction) ImagemapAction added in v1.1.0

func (a *URIImagemapAction) ImagemapAction()

ImagemapAction implements ImagemapAction interface

func (*URIImagemapAction) MarshalJSON

func (a *URIImagemapAction) MarshalJSON() ([]byte, error)

MarshalJSON method of URIImagemapAction

type UnlinkUserRichMenuCall added in v1.1.0

type UnlinkUserRichMenuCall struct {
	// contains filtered or unexported fields
}

UnlinkUserRichMenuCall type

func (*UnlinkUserRichMenuCall) Do added in v1.1.0

Do method

func (*UnlinkUserRichMenuCall) WithContext added in v1.1.0

WithContext method

type UpdateLIFFCall added in v1.2.1

type UpdateLIFFCall struct {
	// contains filtered or unexported fields
}

UpdateLIFFCall type

func (*UpdateLIFFCall) Do added in v1.2.1

func (call *UpdateLIFFCall) Do() (*BasicResponse, error)

Do method

func (*UpdateLIFFCall) WithContext added in v1.2.1

func (call *UpdateLIFFCall) WithContext(ctx context.Context) *UpdateLIFFCall

WithContext method

type UploadRichMenuImageCall added in v1.1.0

type UploadRichMenuImageCall struct {
	// contains filtered or unexported fields
}

UploadRichMenuImageCall type

func (*UploadRichMenuImageCall) Do added in v1.1.0

Do method

func (*UploadRichMenuImageCall) WithContext added in v1.1.0

WithContext method

type UserProfileResponse

type UserProfileResponse struct {
	UserID        string `json:"userId"`
	DisplayName   string `json:"displayName"`
	PictureURL    string `json:"pictureUrl"`
	StatusMessage string `json:"statusMessage"`
}

UserProfileResponse type

type VideoMessage

type VideoMessage struct {
	ID                 string
	OriginalContentURL string
	PreviewImageURL    string
	// contains filtered or unexported fields
}

VideoMessage type

func NewVideoMessage

func NewVideoMessage(originalContentURL, previewImageURL string) *VideoMessage

NewVideoMessage function

func (*VideoMessage) MarshalJSON

func (m *VideoMessage) MarshalJSON() ([]byte, error)

MarshalJSON method of VideoMessage

func (*VideoMessage) Message added in v1.1.0

func (*VideoMessage) Message()

Message implements Message interface

func (*VideoMessage) WithQuickReplies

func (m *VideoMessage) WithQuickReplies(items *QuickReplyItems) SendingMessage

WithQuickReplies method of VideoMessage

type View added in v1.2.1

type View struct {
	Type LIFFViewType `json:"type"`
	URL  string       `json:"url"`
}

View type

type ViewRequest added in v1.2.1

type ViewRequest struct {
	View View `json:"view"`
}

ViewRequest type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL