Documentation ¶
Index ¶
- Variables
- func Find(values []string, val string) (int, bool)
- type Attachment
- type Bot
- func (bot *Bot) Add(q string, r string)
- func (bot *Bot) Adds(qs []string, rs []string) error
- func (bot *Bot) CallbackHandler(w http.ResponseWriter, r *http.Request)
- func (bot *Bot) Debug() string
- func (bot *Bot) FullDebug() string
- func (bot *Bot) Get(q string) (string, error)
- func (bot *Bot) GetLastMessage(id string) (string, error)
- func (bot *Bot) HandleMessage(inMessage Message, id string)
- func (bot *Bot) LenQueries() int
- func (bot *Bot) LenResponses(q string) (int, error)
- func (bot *Bot) Load(path string) error
- func (bot *Bot) PeriodicSave(path string)
- func (bot *Bot) RemoveQueries(qs []string) error
- func (bot *Bot) RemoveQuery(q string) error
- func (bot *Bot) RemoveResponse(q string, r string) error
- func (bot *Bot) RemoveResponses(qs []string, rs []string) error
- func (bot *Bot) Save(path string) error
- func (bot *Bot) ShowQueries() []string
- func (bot *Bot) ShowResponses(q string) ([]string, error)
- func (bot *Bot) TestHandler(w http.ResponseWriter, r *http.Request)
- func (bot *Bot) UpdateLastMessage(id string, message string)
- func (bot *Bot) ValidStrategy() bool
- func (bot *Bot) VerificationHandler(w http.ResponseWriter, r *http.Request)
- type Callback
- type Config
- type Entry
- type Env
- type GombalErrors
- type Message
- type Messaging
- type Payload
- type Postback
- type QuickReply
- type ReplyTo
- type Response
- type Tuple
- type User
- type UserWithRef
Constants ¶
This section is empty.
Variables ¶
var ConfigPath = path.Join(configDir, "config.yaml")
var DataPath = path.Join(dataDir, "data.json")
var FacebookApi = "https://graph.facebook.com/v2.6/me/messages?access_token=%s"
Functions ¶
Types ¶
type Attachment ¶ added in v0.0.2
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Bot is the data structure of the ChatBot.
func (*Bot) CallbackHandler ¶
func (bot *Bot) CallbackHandler(w http.ResponseWriter, r *http.Request)
func (*Bot) FullDebug ¶
FullDebug displays the learned queries, possible responses and its weights in a nice format
func (*Bot) HandleMessage ¶
func (*Bot) LenQueries ¶
LenQueries get the total number of learned queries by the ChatBot
func (*Bot) LenResponses ¶
LenResponses get the total number of learned responses for a query by the ChatBot
func (*Bot) PeriodicSave ¶
func (*Bot) RemoveQueries ¶
RemoveQueries delete multiple queries from the ChatBot Database
func (*Bot) RemoveQuery ¶
RemoveQuery delete a specific query from the ChatBot Database
func (*Bot) RemoveResponse ¶
RemoveResponse delete a specific response for a specific query from the DataBase
func (*Bot) RemoveResponses ¶
RemoveResponses delete responses from the respective queries from the DataBase
func (*Bot) ShowQueries ¶
ShowQueries shows all of the learned queries by the ChatBot
func (*Bot) ShowResponses ¶
ShowResponses shows all of the learned responses by the ChatBot
func (*Bot) TestHandler ¶
func (bot *Bot) TestHandler(w http.ResponseWriter, r *http.Request)
func (*Bot) UpdateLastMessage ¶
func (*Bot) ValidStrategy ¶
func (*Bot) VerificationHandler ¶
func (bot *Bot) VerificationHandler(w http.ResponseWriter, r *http.Request)
type Env ¶
type GombalErrors ¶
type GombalErrors struct {
// contains filtered or unexported fields
}
func (*GombalErrors) Error ¶
func (e *GombalErrors) Error() string
Error returns the error message related to the Gombal Package
type Message ¶ added in v0.0.2
type Message struct { MID string `json:"mid,omitempty"` Text string `json:"text,omitempty"` QuickReply *QuickReply `json:"quick_reply,omitempty"` ReplyTo *ReplyTo `json:"reply_to,omitempty"` Attachments *[]Attachment `json:"attachments,omitempty"` }
type Messaging ¶ added in v0.0.2
type Messaging struct { Sender UserWithRef `json:"sender,omitempty"` Recipient User `json:"recipient,omitempty"` Timestamp int `json:"timestamp,omitempty"` Message Message `json:"message,omitempty"` Postback Postback `json:"postback,omitempty"` }
type QuickReply ¶ added in v0.0.2
type QuickReply struct {
Payload string `json:"payload,omitempty"`
}