messenger

package
v0.0.0-...-a8b6b34 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload,omitempty"`
}

type Button

type Button struct {
	Type    string `json:"type"`
	Title   string `json:"title"`
	Payload string `json:"payload"`
}

type ButtonPayload

type ButtonPayload struct {
	TemplateType string `json:"template_type"`
	Text         string `json:"text"`
	Buttons      `json:"buttons"`
}

type Buttons

type Buttons []Button

type Element

type Element struct {
	Title    string `json:"title"`
	Subtitle string `json:"subtitle,omitempty"`
}

type Entry

type Entry struct {
	ID        string      `json:"id"`
	Time      int         `json:"time"`
	Messaging []Messaging `json:"messaging"`
}

type ErrorBody

type ErrorBody struct {
	Message      string `json:"message"`
	Type         string `json:"type"`
	Code         int    `json:"code"`
	ErrorSubCode int    `json:"error_subcode,omitempty"`
	FbtraceID    string `json:"fbtrace_id"`
}

type ListPayload

type ListPayload struct {
	TemplateType    string    `json:"template_type"`
	TopElementStyle string    `json:"top_element_style,omitempty"`
	Elements        []Element `json:"elements"`
}

type Message

type Message struct {
	Mid           string `json:"mid,omitempty"`
	Text          string `json:"text,omitempty"`
	*QuickReply   `json:"quick_reply,omitempty"`
	*Attachment   `json:"attachment,omitempty"`
	*QuickReplies `json:"quick_replies,omitempty"`
}

type Messaging

type Messaging struct {
	Sender    `json:"sender"`
	Recipient `json:"recipient"`
	Timestamp int `json:"timestamp"`
	*Message  `json:"message,omitempty"`
	*Postback `json:"postback,omitempty"`
}

type Messenger

type Messenger struct {
	VerifyToken string
	AccessToken string
}

func New

func New() Messenger

func (*Messenger) Received

func (m *Messenger) Received(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Messenger) SendConfirmation

func (m *Messenger) SendConfirmation(id string, cmd string)

func (*Messenger) SendListMessage

func (m *Messenger) SendListMessage(id string, StringMap map[string]string)

func (*Messenger) SendQuickReplies

func (m *Messenger) SendQuickReplies(id string, payload string)

func (*Messenger) SendTextMessage

func (m *Messenger) SendTextMessage(id string, message string)

Using message tag to send notification Reference: https://developers.facebook.com/docs/messenger-platform/send-messages/message-tags/

func (*Messenger) SetGreetingText

func (m *Messenger) SetGreetingText(greetingStrings []string)

SetGreetingText set messenger greeting text https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/greeting

func (*Messenger) Verify

type MsgErr

type MsgErr struct {
	ErrorBody `json:"error"`
}

type Postback

type Postback struct {
	Payload string `json:"payload"`
}

type QuickReplies

type QuickReplies []QuickReply

type QuickReply

type QuickReply struct {
	ContentType string `json:"content_type,omitempty"`
	Title       string `json:"title,omitempty"`
	Payload     string `json:"payload,omitempty"`
}

type Recipient

type Recipient struct {
	ID string `json:"id"`
}

type Referral

type Referral struct {
	Ref    string `json:"ref"`
	Source string `json:"source"`
	Type   string `json:"type"`
}

type Request

type Request struct {
	Recipient   `json:"recipient"`
	Message     `json:"message"`
	MessageType string `json:"message_type"`
	Tag         string `json:"tag"`
}

type Sender

type Sender struct {
	ID string `json:"id"`
}

type Webhook

type Webhook struct {
	Object string  `json:"object"`
	Entry  []Entry `json:"entry"`
}

Jump to

Keyboard shortcuts

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