botinput

package
v0.57.6 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 6 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 PhotoMessageItem interface {
	GetFileID() string
	GetFileUniqueID() string
	GetWidth() int
	GetHeight() int
	GetFileSize() int
}

type SharedUserMessageItem added in v0.41.0

type SharedUserMessageItem interface {
	GetBotUserID() string
	GetUsername() string
	GetFirstName() string
	GetLastName() string
	GetPhotos() []PhotoMessageItem
}

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?
	//GetChatInstanceID() string  // Telegram only?
	GetFrom() WebhookSender
	GetMessage() WebhookMessage
	GetData() string
	Chat() WebhookChat
}

WebhookCallbackQuery represents a single callback query message

type WebhookChat

type WebhookChat interface {
	GetID() string
	GetType() string
	IsGroupChat() bool
}

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

type WebhookEntry interface {
	GetID() interface{}
	GetTime() time.Time
}

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
	WebhookInputSharedUsers // Telegram
)

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

type WebhookReferralMessage interface {
	Type() string
	Source() string
	RefData() string
}

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
	GetRequestID() int
	GetSharedUsers() []SharedUserMessageItem
}

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

Jump to

Keyboard shortcuts

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