Documentation ΒΆ
Index ΒΆ
- Variables
- func ActionAudio(flow *Flow, channel Channel) (bool, error)
- func ActionButton(flow *Flow, channel Channel) (bool, error)
- func ActionDocument(flow *Flow, channel Channel) (bool, error)
- func ActionImage(flow *Flow, channel Channel) (bool, error)
- func ActionInput(flow *Flow, channel Channel) (bool, error)
- func ActionText(flow *Flow, channel Channel) (bool, error)
- func ActionVideo(flow *Flow, channel Channel) (bool, error)
- func ActionWait(flow *Flow, channel Channel) (bool, error)
- func FormatTestError(expect, have interface{}) string
- func Int64ToString(number int64) string
- func IsURL(str string) bool
- func NewError(fn string, err error) error
- func ParseTemplate(texts []string) string
- func RunAction(flow *Flow, channel Channel) (bool, error)
- func RunActionError(flow *Flow, channel Channel) (bool, error)
- func SetCustomActions(custom ActionsMap)
- func StartBot(base Flow, channel Channel, persist Persist) error
- func StringToInt64(str string) int64
- type ActionsMap
- type Channel
- type Discord
- func (ds *Discord) Next(in chan Interaction)
- func (ds *Discord) RespondInteraction(in *discordgo.Interaction)
- func (ds *Discord) SendAudio(in Interaction) error
- func (ds *Discord) SendButton(in Interaction) error
- func (ds *Discord) SendDocument(in Interaction) error
- func (ds *Discord) SendFile(sessionID, text, path string) error
- func (ds *Discord) SendImage(in Interaction) error
- func (ds *Discord) SendText(in Interaction) error
- func (ds *Discord) SendVideo(in Interaction) error
- type Flow
- type Interaction
- func NewInteractionMessageAudio(sessionID string, audio string, text string) Interaction
- func NewInteractionMessageButton(sessionID string, buttons []string, text string) Interaction
- func NewInteractionMessageDocument(sessionID string, document string, text string) Interaction
- func NewInteractionMessageImage(sessionID string, image string, text string) Interaction
- func NewInteractionMessageText(sessionID string, text string) Interaction
- func NewInteractionMessageVideo(sessionID string, video string, text string) Interaction
- type InteractionParameters
- type InteractionType
- type Local
- type Persist
- type Step
- type StepParameters
- type Steps
- type Telegram
- func (tg *Telegram) Next(in chan Interaction)
- func (tg *Telegram) SendAudio(in Interaction) error
- func (tg *Telegram) SendButton(in Interaction) error
- func (tg *Telegram) SendDocument(in Interaction) error
- func (tg *Telegram) SendImage(in Interaction) error
- func (tg *Telegram) SendText(in Interaction) error
- func (tg *Telegram) SendVideo(in Interaction) error
Constants ΒΆ
This section is empty.
Variables ΒΆ
View Source
var Debug = true
View Source
var EnableLocalPersist = true
Functions ΒΆ
func FormatTestError ΒΆ
func FormatTestError(expect, have interface{}) string
func Int64ToString ΒΆ
func ParseTemplate ΒΆ
func SetCustomActions ΒΆ added in v1.1.0
func SetCustomActions(custom ActionsMap)
func StringToInt64 ΒΆ
Types ΒΆ
type Channel ΒΆ
type Channel interface { SendAudio(Interaction) error SendButton(Interaction) error SendDocument(Interaction) error SendImage(Interaction) error SendText(Interaction) error SendVideo(Interaction) error Next(chan Interaction) }
func NewDiscord ΒΆ added in v1.4.0
func NewTelegram ΒΆ
type Discord ΒΆ added in v1.4.0
type Discord struct {
// contains filtered or unexported fields
}
func (*Discord) Next ΒΆ added in v1.4.0
func (ds *Discord) Next(in chan Interaction)
func (*Discord) RespondInteraction ΒΆ added in v1.4.0
func (ds *Discord) RespondInteraction(in *discordgo.Interaction)
func (*Discord) SendAudio ΒΆ added in v1.4.0
func (ds *Discord) SendAudio(in Interaction) error
func (*Discord) SendButton ΒΆ added in v1.4.0
func (ds *Discord) SendButton(in Interaction) error
func (*Discord) SendDocument ΒΆ added in v1.4.0
func (ds *Discord) SendDocument(in Interaction) error
func (*Discord) SendImage ΒΆ added in v1.4.0
func (ds *Discord) SendImage(in Interaction) error
func (*Discord) SendText ΒΆ added in v1.4.0
func (ds *Discord) SendText(in Interaction) error
func (*Discord) SendVideo ΒΆ added in v1.4.0
func (ds *Discord) SendVideo(in Interaction) error
type Flow ΒΆ
type Flow struct { SessionID string Name string `yaml:"name"` Steps Steps `yaml:"steps"` Current *Step }
func (*Flow) Next ΒΆ
func (flow *Flow) Next(in Interaction) *Flow
type Interaction ΒΆ
type Interaction struct { SessionID string `json:"sessionID"` Type InteractionType `json:"type"` Parameters InteractionParameters `json:"parameters"` Custom map[string]any `json:"custom"` }
func NewInteractionMessageAudio ΒΆ
func NewInteractionMessageAudio(sessionID string, audio string, text string) Interaction
func NewInteractionMessageButton ΒΆ
func NewInteractionMessageButton(sessionID string, buttons []string, text string) Interaction
func NewInteractionMessageDocument ΒΆ
func NewInteractionMessageDocument(sessionID string, document string, text string) Interaction
func NewInteractionMessageImage ΒΆ
func NewInteractionMessageImage(sessionID string, image string, text string) Interaction
func NewInteractionMessageText ΒΆ
func NewInteractionMessageText(sessionID string, text string) Interaction
func NewInteractionMessageVideo ΒΆ
func NewInteractionMessageVideo(sessionID string, video string, text string) Interaction
type InteractionParameters ΒΆ
type InteractionParameters StepParameters
type InteractionType ΒΆ
type InteractionType string
const ( MESSAGE InteractionType = "message" EVENT = "event" )
type Persist ΒΆ added in v1.4.0
func NewLocalPersist ΒΆ added in v1.4.0
type Step ΒΆ
type Step struct { Action string `yaml:"action"` Next map[string]string `yaml:"next"` Parameters StepParameters `yaml:"parameters"` Responses []Interaction }
func (*Step) AddResponse ΒΆ added in v1.4.0
func (step *Step) AddResponse(in Interaction)
func (*Step) GetLastResponse ΒΆ added in v1.4.2
func (step *Step) GetLastResponse() Interaction
func (*Step) GetLastResponseText ΒΆ added in v1.4.2
type StepParameters ΒΆ
type StepParameters struct { Audio string `yaml:"audio" json:"audio"` Buttons []string `yaml:"buttons" json:"buttons"` Document string `yaml:"document" json:"document"` Image string `yaml:"image" json:"image"` Text string `yaml:"text" json:"text"` Texts []string `yaml:"texts"` Video string `yaml:"video" json:"video"` }
type Telegram ΒΆ
type Telegram struct {
// contains filtered or unexported fields
}
func (*Telegram) Next ΒΆ
func (tg *Telegram) Next(in chan Interaction)
func (*Telegram) SendAudio ΒΆ
func (tg *Telegram) SendAudio(in Interaction) error
func (*Telegram) SendButton ΒΆ
func (tg *Telegram) SendButton(in Interaction) error
func (*Telegram) SendDocument ΒΆ
func (tg *Telegram) SendDocument(in Interaction) error
func (*Telegram) SendImage ΒΆ
func (tg *Telegram) SendImage(in Interaction) error
func (*Telegram) SendText ΒΆ
func (tg *Telegram) SendText(in Interaction) error
func (*Telegram) SendVideo ΒΆ
func (tg *Telegram) SendVideo(in Interaction) error
Source Files ΒΆ
Click to show internal directories.
Click to hide internal directories.