Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildMessageCallback ¶ added in v1.3.0
type EventMessage ¶
type EventMessage struct { // main data Text string `json:"text"` // instead of main data Callback BuildMessageCallback `json:"-"` // use it to redefine message // additional events OnEvent OnEventCallback `json:"-"` // optional Image string `json:"image"` // local filename or URL File FileData `json:"file"` Video VideoData `json:"video"` Buttons []MessageButton `json:"buttons"` Format ParseFormat `json:"format"` ButtonsIsColumns bool `json:"buttonsIsColumns"` Conversion string `json:"conversion"` OnConversion OnConversionCallback `json:"-"` PinThisMessage bool `json:"pin"` }
EventMessage - funnel event message data
type Funnel ¶
type Funnel struct { // public Data FunnelData Script FunnelScript // contains filtered or unexported fields }
Funnel - telegram bot funnel
func NewFunnel ¶
func NewFunnel(data FunnelData, script FunnelScript) *Funnel
NewFunnel - funnel constructor
func (*Funnel) EnableUsersFeature ¶ added in v1.0.9
func (f *Funnel) EnableUsersFeature(feature UsersFeature)
EnableUsersFeature !
func (*Funnel) GetEventQueryHandler ¶ added in v1.6.0
func (f *Funnel) GetEventQueryHandler( eventMessageID string, ) (*QueryHandler, error)
type FunnelData ¶
FunnelData - data container for Funnel struct
type FunnelEvent ¶
type FunnelEvent struct {
Message EventMessage `json:"message"`
}
FunnelEvent - user interaction event
type FunnelScript ¶
type FunnelScript map[string]FunnelEvent // message ID -> event
FunnelScript - funnel scenario
type MessageButton ¶
type MessageButton struct { Text string `json:"text"` NextMessageID string `json:"nextID"` // optional for URL-buttons URL string `json:"url"` // optional. only for URL-buttons }
MessageButton - funnel event message button
type MessageType ¶ added in v1.7.5
type MessageType string
const ( MessageTypeText MessageType = "text" MessageTypePhoto MessageType = "photo" MessageTypeDocument MessageType = "document" MessageTypeVideo MessageType = "video" )
type OnConversionCallback ¶ added in v1.6.2
type OnEventCallback ¶ added in v1.3.0
type ParseFormat ¶ added in v1.6.3
type ParseFormat string
const ( ParseFormatMarkdown ParseFormat = ParseFormat(tb.ModeMarkdown) ParseFormatHTML ParseFormat = ParseFormat(tb.ModeHTML) )
type QueryHandler ¶ added in v1.6.0
type QueryHandler struct { EventMessageID string EventData FunnelEvent Menu *tb.ReplyMarkup ParseMode tb.ParseMode Bot *tb.Bot FilesRoot string // inherit from Funnel Features *funnelFeatures }
telegram user query handler
func (*QueryHandler) CustomHandle ¶ added in v1.6.0
func (q *QueryHandler) CustomHandle(telegramUserID int64) error
Click to show internal directories.
Click to hide internal directories.