Documentation
¶
Index ¶
- func GetWebhookInputTypeIdNameString(whInputType WebhookInputType) string
- type PhotoMessageItem
- type SharedUserMessageItem
- type WebhookActor
- type WebhookAttachment
- type WebhookAudioMessage
- type WebhookCallbackQuery
- type WebhookChat
- type WebhookChosenInlineResult
- type WebhookContactMessage
- type WebhookConversationStarted
- type WebhookDelivery
- type WebhookEntry
- type WebhookInlineQuery
- type WebhookInput
- type WebhookInputType
- type WebhookLeftChatMembersMessage
- type WebhookMessage
- type WebhookNewChatMembersMessage
- type WebhookPhotoMessage
- type WebhookPostback
- type WebhookRecipient
- type WebhookReferralMessage
- type WebhookSender
- type WebhookSharedUsersMessage
- type WebhookStickerMessage
- type WebhookSubscribed
- type WebhookTextMessage
- type WebhookUnsubscribed
- type WebhookUser
- type WebhookVoiceMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWebhookInputTypeIdNameString ¶
func GetWebhookInputTypeIdNameString(whInputType WebhookInputType) string
Types ¶
type PhotoMessageItem ¶ added in v0.41.0
type SharedUserMessageItem ¶ added in v0.41.0
type SharedUserMessageItem interface {
}
type WebhookActor ¶
type WebhookActor interface {
Platform() string // TODO: Consider removing this?
GetID() any
IsBotUser() bool
GetFirstName() string
GetLastName() string
GetUserName() string
GetLanguage() string
}
WebhookActor represents sender
type WebhookAttachment ¶
type WebhookAttachment interface {
Type() string // Enum(image, video, audio) for Facebook
PayloadUrl() string // 'payload.url' for Facebook
}
WebhookAttachment represents attachment to a message
type WebhookAudioMessage ¶
type WebhookAudioMessage interface {
WebhookMessage
}
WebhookAudioMessage represents a single audio message
type WebhookCallbackQuery ¶
type WebhookCallbackQuery interface {
GetID() string
GetInlineMessageID() string // Telegram only?
GetFrom() WebhookSender
GetMessage() WebhookMessage
GetData() string
Chat() WebhookChat
}
WebhookCallbackQuery represents a single callback query message
type WebhookChat ¶
WebhookChat represents botChat of a messenger
type WebhookChosenInlineResult ¶
type WebhookChosenInlineResult interface {
GetResultID() string
GetInlineMessageID() string // Telegram only?
GetFrom() WebhookSender
GetQuery() string
}
WebhookChosenInlineResult represents a single report message on chosen inline result
type WebhookContactMessage ¶
type WebhookContactMessage interface {
GetPhoneNumber() string
GetFirstName() string
GetLastName() string
GetBotUserID() string
GetVCard() string
}
WebhookContactMessage represents a single contact message
type WebhookConversationStarted ¶
type WebhookConversationStarted interface {
ConversationStartedMessage() interface{}
}
WebhookConversationStarted represents a single message about new conversation
type WebhookDelivery ¶
type WebhookDelivery interface {
Payload() string
}
WebhookDelivery represents a single delivery report message
type WebhookEntry ¶
WebhookEntry represents a single message from a messenger user
type WebhookInlineQuery ¶
type WebhookInlineQuery interface {
GetID() interface{}
GetInlineQueryID() string
GetFrom() WebhookSender
GetQuery() string
GetOffset() string
}
WebhookInlineQuery represents a single inline message
type WebhookInput ¶
type WebhookInput interface {
GetSender() WebhookUser
GetRecipient() WebhookRecipient
GetTime() time.Time
InputType() WebhookInputType
BotChatID() (string, error)
Chat() WebhookChat
LogRequest() // TODO: should not be part of Input? If should - specify why
}
WebhookInput represent a single message '/entry/messaging' for Facebook Messenger
type WebhookInputType ¶
type WebhookInputType int
WebhookInputType is enum of input type
const ( // WebhookInputUnknown is an unknown input type WebhookInputUnknown WebhookInputType = iota // WebhookInputNotImplemented is not implemented input type WebhookInputNotImplemented // WebhookInputText is a text input type WebhookInputText // Facebook, Telegram, Viber // WebhookInputVoice is voice input type WebhookInputVoice // WebhookInputPhoto is a photo input type WebhookInputPhoto // WebhookInputAudio is an audio input type WebhookInputAudio // WebhookInputContact is a contact input type WebhookInputContact // Facebook, Telegram, Viber // WebhookInputPostback is unknown input type WebhookInputPostback // WebhookInputDelivery is a postback input type WebhookInputDelivery // WebhookInputAttachment is a delivery report input type WebhookInputAttachment // WebhookInputInlineQuery is an attachment input type WebhookInputInlineQuery // Telegram // WebhookInputCallbackQuery is inline input type WebhookInputCallbackQuery // WebhookInputReferral is a callback input type WebhookInputReferral // FBM // WebhookInputChosenInlineResult is chosen inline result input type WebhookInputChosenInlineResult // Telegram // WebhookInputSubscribed is subscribed input type WebhookInputSubscribed // Viber // WebhookInputUnsubscribed is unsubscribed input type WebhookInputUnsubscribed // Viber // WebhookInputConversationStarted is conversation started input type WebhookInputConversationStarted // Viber // WebhookInputNewChatMembers is new botChat members input type WebhookInputNewChatMembers // Telegram groups // WebhookInputLeftChatMembers is left botChat members input type WebhookInputLeftChatMembers // WebhookInputSticker is a sticker input type WebhookInputSticker )
type WebhookLeftChatMembersMessage ¶
type WebhookLeftChatMembersMessage interface {
BotChatID() (string, error)
LeftChatMembers() []WebhookActor
}
WebhookLeftChatMembersMessage represents a single message about a member leaving a botChat
type WebhookMessage ¶
type WebhookMessage interface {
WebhookInput
IntID() int64
StringID() string
Chat() WebhookChat
}
WebhookMessage represents a single message
type WebhookNewChatMembersMessage ¶
type WebhookNewChatMembersMessage interface {
BotChatID() (string, error)
NewChatMembers() []WebhookActor
}
WebhookNewChatMembersMessage represents a single message about a new member of a botChat
type WebhookPhotoMessage ¶
type WebhookPhotoMessage interface {
WebhookMessage
}
WebhookPhotoMessage represents a single photo message
type WebhookPostback ¶
type WebhookPostback interface {
PostbackMessage() interface{}
Payload() string
}
WebhookPostback represents a single postback message
type WebhookRecipient ¶
type WebhookRecipient interface {
WebhookActor
}
WebhookRecipient represents receiver
type WebhookReferralMessage ¶
WebhookReferralMessage represents a single referral message https://developers.facebook.com/docs/messenger-platform/webhook-reference/referral
type WebhookSender ¶
type WebhookSender interface {
GetAvatar() string // Extension to support avatar (Viber)
WebhookActor
}
WebhookSender represents sender with avatar
type WebhookSharedUsersMessage ¶ added in v0.44.0
type WebhookSharedUsersMessage interface {
WebhookMessage
}
WebhookSharedUsersMessage represents a message with information about shared user
type WebhookStickerMessage ¶
type WebhookStickerMessage interface {
WebhookMessage
}
WebhookStickerMessage represents single sticker message
type WebhookSubscribed ¶
type WebhookSubscribed interface {
SubscribedMessage() interface{}
}
WebhookSubscribed represents a subscription message
type WebhookTextMessage ¶
type WebhookTextMessage interface {
WebhookMessage
Text() string
IsEdited() bool
}
WebhookTextMessage represents a single text message
type WebhookUnsubscribed ¶
type WebhookUnsubscribed interface {
UnsubscribedMessage() interface{}
}
WebhookUnsubscribed represents a message when user unsubscribe
type WebhookUser ¶
type WebhookUser interface {
WebhookSender
// GetCountry is an extension to support language & country (Viber)
GetCountry() string
}
WebhookUser represents sender with country
type WebhookVoiceMessage ¶
type WebhookVoiceMessage interface {
WebhookMessage
}
WebhookVoiceMessage represents a single voice message