Documentation ¶
Index ¶
- func CheckIfTokenValid(ctx context.Context, token string) (bool, error)
- func GetMessageContent(_ context.Context, messageID string) ([]byte, error)
- func NewBot(ctx context.Context, useLongTermToken bool) error
- func NewBotClient(at string) error
- func PostChannelAccessToken(ctx context.Context) (string, error)
- func ReplyMessage(_ context.Context, replyToken string, text string) error
- type LineMessage
- type LineWebhookEvent
- type LineWebhookRequest
- type LineWebhookSource
- type PostChannelAccessTokenRequest
- type PostChannelAccessTokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessageContent ¶
func NewBotClient ¶
func PostChannelAccessToken ¶
PostChannelAccessToken はチャンネルアクセストークンを取得する。 ChannelAccessToken の登録上限は30件。乱発は禁止。 ChannelAccessToken の上限に達すると新規の発行はできなくなるので、永続化して都度再利用、有効期限が 切れたら refresh する。 ref: https://developers.line.biz/ja/docs/messaging-api/channel-access-tokens/
Types ¶
type LineMessage ¶
type LineWebhookEvent ¶
type LineWebhookEvent struct { Type string `json:"type"` Message *LineMessage `json:"message"` ReplyToken string `json:"replyToken"` WebhookEventId string `json:"webhookEventId"` Timestamp int64 `json:"timestamp"` Source *LineWebhookSource `json:"source"` }
type LineWebhookRequest ¶
type LineWebhookRequest struct { Destination string `json:"destination"` Events []*LineWebhookEvent `json:"events"` }
Described at https://developers.line.biz/ja/reference/messaging-api/#webhook-event-objects
type LineWebhookSource ¶
type PostChannelAccessTokenRequest ¶
type PostChannelAccessTokenRequest struct { GrantType string `json:"grant_type"` ClientAssertionType string `json:"client_assertion_type"` ClientAssertion string `json:"client_assertion"` }
Described at https://developers.line.biz/ja/reference/messaging-api/#issue-channel-access-token-v2-1
Click to show internal directories.
Click to hide internal directories.