35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package whatsapp
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.mau.fi/whatsmeow/types"
|
|
)
|
|
|
|
// ClientType identifies the type of WhatsApp client
|
|
type ClientType string
|
|
|
|
const (
|
|
ClientTypeWhatsmeow ClientType = "whatsmeow"
|
|
ClientTypeBusinessAPI ClientType = "business-api"
|
|
)
|
|
|
|
// Client represents any WhatsApp client implementation (whatsmeow or Business API)
|
|
type Client interface {
|
|
// Connection Management
|
|
Connect(ctx context.Context) error
|
|
Disconnect() error
|
|
IsConnected() bool
|
|
|
|
// Account Information
|
|
GetID() string
|
|
GetPhoneNumber() string
|
|
GetType() string
|
|
|
|
// Message Sending
|
|
SendTextMessage(ctx context.Context, jid types.JID, text string) (messageID string, err error)
|
|
SendImage(ctx context.Context, jid types.JID, imageData []byte, mimeType string, caption string) (messageID string, err error)
|
|
SendVideo(ctx context.Context, jid types.JID, videoData []byte, mimeType string, caption string) (messageID string, err error)
|
|
SendDocument(ctx context.Context, jid types.JID, documentData []byte, mimeType string, filename string, caption string) (messageID string, err error)
|
|
}
|