Documentation
¶
Index ¶
Constants ¶
View Source
const ( IncomingMessage = "INCOMING_MESSAGE" OutgoingMessage = "OUTGOING_MESSAGE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotClientList ¶
BotClientList defines the variable to store WaBot objects
type ReplyMessage ¶
type ReplyMessage struct {
Message string
}
type WaBot ¶
type WaBot struct { Client *whatsmeow.Client Log *logger.Logger HttpClient *http.Client EventHandlerID uint32 Phone string WebhookUrl string EchoMsg bool WHookEnabled bool }
WaBot defines the bot client
func LoginExistingWASession ¶
func LoginExistingWASession(httpClient *http.Client, webhookUrl string, container *sqlstore.Container, log *logger.Logger, jidStr, phone string, echoMsg, wHookEnabled bool) (*WaBot, error)
LoginExistingWASession logins with an existing session on the database
func NewWhatsappClient ¶
func NewWhatsappClient(httpClient *http.Client, webhookUrl string, container *sqlstore.Container, log *logger.Logger, phone, fileDir string, echoMsg, wHookEnabled bool) (*WaBot, error)
NewWhatsappClient initializes Whatsapp client
type WebhookBody ¶
type WebhookBody struct { EventType string `json:"event_type"` MsgId string `json:"msg_id"` MsgType string `json:"msg_type"` Phone string `json:"phone"` Name string `json:"name"` Message string `json:"message"` TargetJID string `json:"target_jid"` TargetDevice string `json:"target_device"` Timestamp string `json:"timestamp"` }
Click to show internal directories.
Click to hide internal directories.