Documentation ¶
Index ¶
- Constants
- Variables
- func SendMessage(message []byte, phoneNumberID string) error
- func UploadSticker(path string, phoneNumberID string) (string, error)
- type Change
- type ChangeValue
- type Contact
- type Context
- type Entry
- type Media
- type MediaURLResponse
- type Message
- func (incoming Message) ContentLength() (*MediaURLResponse, error)
- func (incoming Message) DownloadMedia(path string, url string) error
- func (incoming Message) IsGroup() bool
- func (incoming Message) IsImage() bool
- func (incoming Message) IsMedia() bool
- func (incoming Message) IsSticker() bool
- func (incoming Message) IsVideo() bool
- func (incoming Message) MediaID() string
- func (incoming Message) MediaType() string
- func (m Message) Time() string
- type MessagingProduct
- type Metadata
- type Response
- type Sticker
- type StickerResponse
- type Text
- type TextResponse
- type UploadMediaRequest
- type UploadMediaResponse
- type WhatsappIncomingMessage
Constants ¶
View Source
const FacebookGraphAPI = "https://graph.facebook.com/v15.0/"
Variables ¶
View Source
var (
BearerToken = "Bearer " + os.Getenv("BEARER_ACCESS_TOKEN")
)
Functions ¶
func SendMessage ¶
Types ¶
type Change ¶
type Change struct { Value ChangeValue `json:"value"` Field string `json:"field"` }
type ChangeValue ¶
type MediaURLResponse ¶
type Message ¶
type Message struct { From string `json:"from"` ID string `json:"id"` Timestamp string `json:"timestamp"` Type string `json:"type"` Text struct { Body string `json:"body"` } `json:"text"` Sticker struct { Media Animated string `json:"animated"` } `json:"sticker"` Image Media `json:"image"` Video Media `json:"video"` }
func (Message) ContentLength ¶
func (incoming Message) ContentLength() (*MediaURLResponse, error)
type MessagingProduct ¶
type MessagingProduct string
func (MessagingProduct) MarshalJSON ¶
func (e MessagingProduct) MarshalJSON() ([]byte, error)
implement the Unmarshaler interface on MessagingProduct
type Response ¶
type Response struct { Type string `json:"type"` Context Context `json:"context"` To string `json:"to"` MessagingProduct MessagingProduct `json:"messaging_product"` }
type StickerResponse ¶
type TextResponse ¶
type UploadMediaRequest ¶
type UploadMediaResponse ¶
type UploadMediaResponse struct {
ID string `json:"id"`
}
type WhatsappIncomingMessage ¶
func UnmarshalIncomingMessage ¶
func UnmarshalIncomingMessage(req *http.Request) (*WhatsappIncomingMessage, error)
Click to show internal directories.
Click to hide internal directories.