tgfun

package module
v0.0.0-...-261ab8d Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventMessage

type EventMessage struct {
	//ID      string          `json:"id"`
	Text    string          `json:"text"`
	Image   string          `json:"image"`   // local filename or URL. optional
	Buttons []MessageButton `json:"buttons"` // optional
}

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, error)

NewFunnel - funnel constructor

func (*Funnel) Run

func (f *Funnel) Run() error

Run funnel. This is a non-blocking operation

type FunnelData

type FunnelData struct {
	Token string `json:"token"`
}

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

Jump to

Keyboard shortcuts

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