Documentation ¶
Index ¶
- Constants
- func ParseQuestion(script ScriptYaml, state ScriptState)
- func ProcessString(in interface{}) string
- type Bot
- func (b *Bot) ActionHandler(w http.ResponseWriter, r *http.Request)
- func (b *Bot) AwaitMessages()
- func (b *Bot) Connect(authToken string)
- func (b *Bot) CreatePost(c *model.Channel, line string, props model.StringInterface)
- func (b *Bot) Disconnect()
- func (b *Bot) FindBotChannel(configChannelName string, adminUsername string)
- func (b *Bot) GetNameIconForChannel(c *model.Channel) (string, string)
- func (b *Bot) GetTextAnswer(q *ScriptAnswer, c *model.Channel) string
- func (b *Bot) GetTextQuestion(q *ScriptQuestion, c *model.Channel) string
- func (b *Bot) HandleJoinedUser(u *model.User)
- func (b *Bot) LoadScript()
- func (b *Bot) LoginAsTheBotUser(authToken string)
- func (b *Bot) MakeSureServerIsRunning()
- func (b *Bot) PrintQuestion(c *model.Channel, q *ScriptQuestion, disablePostID string)
- func (b *Bot) Register()
- func (b *Bot) SetChannelPropsForTargetUser(u *model.User, c *model.Channel)
- func (b *Bot) StartActionsHTTPd(bindIP string, bindPort string)
- func (b *Bot) StartConversation(c *model.Channel)
- func (b *Bot) UserTyping(c *model.Channel)
- type ScriptAnswer
- type ScriptQuestion
- type ScriptState
- type ScriptYaml
Constants ¶
View Source
const ActionURLSuffix = "/action"
View Source
const LivelinessSuffix = "/_healthz"
Variables ¶
This section is empty.
Functions ¶
func ParseQuestion ¶
func ParseQuestion(script ScriptYaml, state ScriptState)
func ProcessString ¶
func ProcessString(in interface{}) string
Types ¶
type Bot ¶
type Bot struct { ChatDomain string CallbackURL string ChannelPrefix string ExternalURL string IsOnline bool // contains filtered or unexported fields }
func (*Bot) ActionHandler ¶
func (b *Bot) ActionHandler(w http.ResponseWriter, r *http.Request)
func (*Bot) AwaitMessages ¶
func (b *Bot) AwaitMessages()
func (*Bot) CreatePost ¶
func (*Bot) Disconnect ¶
func (b *Bot) Disconnect()
func (*Bot) FindBotChannel ¶
func (*Bot) GetNameIconForChannel ¶
func (*Bot) GetTextAnswer ¶
func (b *Bot) GetTextAnswer(q *ScriptAnswer, c *model.Channel) string
func (*Bot) GetTextQuestion ¶
func (b *Bot) GetTextQuestion(q *ScriptQuestion, c *model.Channel) string
func (*Bot) HandleJoinedUser ¶
func (*Bot) LoadScript ¶
func (b *Bot) LoadScript()
func (*Bot) LoginAsTheBotUser ¶
func (*Bot) MakeSureServerIsRunning ¶
func (b *Bot) MakeSureServerIsRunning()
func (*Bot) PrintQuestion ¶
func (b *Bot) PrintQuestion(c *model.Channel, q *ScriptQuestion, disablePostID string)
func (*Bot) SetChannelPropsForTargetUser ¶
func (*Bot) StartActionsHTTPd ¶
func (*Bot) StartConversation ¶
func (*Bot) UserTyping ¶
type ScriptAnswer ¶
type ScriptQuestion ¶
type ScriptState ¶
type ScriptState struct { Questions map[string]*ScriptQuestion Specials map[string][]*ScriptQuestion FromActions map[string]*ScriptQuestion }
type ScriptYaml ¶
type ScriptYaml struct { ID string `yaml:"i"` Special string `yaml:"s"` QuestionEng interface{} `yaml:"q"` QuestionHebMale interface{} `yaml:"qm"` QuestionHebFemale interface{} `yaml:"qf"` ResponseEng string `yaml:"r"` ResponseHebMale string `yaml:"rm"` ResponseHebFemale string `yaml:"rf"` Link string `yaml:"l"` Answer map[string]ScriptYaml `yaml:"a"` }
Click to show internal directories.
Click to hide internal directories.