Documentation
¶
Index ¶
- Constants
- type App
- func (a *App) AllowUnauthed() bool
- func (a *App) ArchiveChat(ctx context.Context, jid types.JID, archive bool) error
- func (a *App) BackfillHistory(ctx context.Context, opts BackfillOptions) (BackfillResult, error)
- func (a *App) Close()
- func (a *App) Connect(ctx context.Context, allowQR bool, qrWriter func(string)) error
- func (a *App) DB() *store.DB
- func (a *App) EnsureAuthed() error
- func (a *App) Events() *out.EventWriter
- func (a *App) MarkChatRead(ctx context.Context, jid types.JID, read bool) error
- func (a *App) MuteChat(ctx context.Context, jid types.JID, mute bool, duration time.Duration) error
- func (a *App) OpenWA() error
- func (a *App) PinChat(ctx context.Context, jid types.JID, pin bool) error
- func (a *App) ResolveMediaOutputPath(info store.MediaDownloadInfo, requested string) (string, error)
- func (a *App) StoreDir() string
- func (a *App) Sync(ctx context.Context, opts SyncOptions) (SyncResult, error)
- func (a *App) Version() string
- func (a *App) WA() WAClient
- type BackfillOptions
- type BackfillResult
- type Options
- type SyncMode
- type SyncOptions
- type SyncResult
- type WAClient
Constants ¶
View Source
const ( DefaultBackfillCount = 50 DefaultBackfillRequests = 1 MaxBackfillCount = 500 MaxBackfillRequests = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) AllowUnauthed ¶
func (*App) ArchiveChat ¶
func (*App) BackfillHistory ¶
func (a *App) BackfillHistory(ctx context.Context, opts BackfillOptions) (BackfillResult, error)
func (*App) EnsureAuthed ¶
func (*App) Events ¶
func (a *App) Events() *out.EventWriter
func (*App) MarkChatRead ¶
func (*App) ResolveMediaOutputPath ¶
func (*App) Sync ¶
func (a *App) Sync(ctx context.Context, opts SyncOptions) (SyncResult, error)
type BackfillOptions ¶
type BackfillResult ¶
type SyncOptions ¶
type SyncOptions struct {
Mode SyncMode
AllowQR bool
OnQRCode func(string)
PairPhoneNumber string
OnPairCode func(string)
AfterConnect func(context.Context) error
DownloadMedia bool
RefreshContacts bool
RefreshGroups bool
RefreshChannels bool
IdleExit time.Duration // only used for bootstrap/once
MaxReconnect time.Duration // max time to attempt reconnection before giving up (0 = unlimited)
MaxMessages int64 // 0 = unlimited
MaxDBSizeBytes int64 // 0 = unlimited
WarnNoLimits bool
WebhookURL string
WebhookSecret string
Verbosity int // future
}
type SyncResult ¶
type SyncResult struct {
MessagesStored int64
}
type WAClient ¶
type WAClient interface {
Close()
IsAuthed() bool
IsConnected() bool
Connect(ctx context.Context, opts wa.ConnectOptions) error
AddEventHandler(handler func(interface{})) uint32
RemoveEventHandler(id uint32)
ReconnectWithBackoff(ctx context.Context, minDelay, maxDelay time.Duration) error
ResolveChatName(ctx context.Context, chat types.JID, pushName string) string
ResolveLIDToPN(ctx context.Context, jid types.JID) types.JID
ResolvePNToLID(ctx context.Context, jid types.JID) types.JID
GetUserInfo(ctx context.Context, jids []types.JID) (map[types.JID]types.UserInfo, error)
IsOnWhatsApp(ctx context.Context, phones []string) ([]types.IsOnWhatsAppResponse, error)
GetContact(ctx context.Context, jid types.JID) (types.ContactInfo, error)
GetAllContacts(ctx context.Context) (map[types.JID]types.ContactInfo, error)
GetJoinedGroups(ctx context.Context) ([]*types.GroupInfo, error)
GetGroupInfo(ctx context.Context, jid types.JID) (*types.GroupInfo, error)
SetGroupName(ctx context.Context, jid types.JID, name string) error
UpdateGroupParticipants(ctx context.Context, group types.JID, users []types.JID, action wa.GroupParticipantAction) ([]types.GroupParticipant, error)
GetGroupInviteLink(ctx context.Context, group types.JID, reset bool) (string, error)
JoinGroupWithLink(ctx context.Context, code string) (types.JID, error)
LeaveGroup(ctx context.Context, group types.JID) error
GetNewsletterInfoWithInvite(ctx context.Context, key string) (*types.NewsletterMetadata, error)
FollowNewsletter(ctx context.Context, jid types.JID) error
UnfollowNewsletter(ctx context.Context, jid types.JID) error
GetSubscribedNewsletters(ctx context.Context) ([]*types.NewsletterMetadata, error)
GetNewsletterInfo(ctx context.Context, jid types.JID) (*types.NewsletterMetadata, error)
SendText(ctx context.Context, to types.JID, text string) (types.MessageID, error)
SendProtoMessage(ctx context.Context, to types.JID, msg *waProto.Message) (types.MessageID, error)
SendProtoMessageWithExtra(ctx context.Context, to types.JID, msg *waProto.Message, mediaHandle string) (types.MessageID, error)
SendReaction(ctx context.Context, chat, sender types.JID, targetID types.MessageID, reaction string) (types.MessageID, error)
SendPoll(ctx context.Context, to types.JID, name string, options []string, selectable int, ephemeral bool) (types.MessageID, error)
SendPollVote(ctx context.Context, pollInfo *types.MessageInfo, options []string) (types.MessageID, error)
DecryptPollVote(ctx context.Context, evt *events.Message) (*waE2E.PollVoteMessage, error)
DecryptSecretEncryptedMessage(ctx context.Context, evt *events.Message) (*waE2E.Message, error)
RevokeMessage(ctx context.Context, chat types.JID, targetID types.MessageID) (types.MessageID, error)
DeleteMessageForMe(ctx context.Context, info types.MessageInfo, deleteMedia bool) error
EditMessage(ctx context.Context, chat types.JID, targetID types.MessageID, text string) (types.MessageID, error)
ArchiveChat(ctx context.Context, target types.JID, archive bool, lastMsgTS time.Time, lastMsgKey *waCommon.MessageKey) error
PinChat(ctx context.Context, target types.JID, pin bool) error
MuteChat(ctx context.Context, target types.JID, mute bool, duration time.Duration) error
MarkChatAsRead(ctx context.Context, target types.JID, read bool, lastMsgTS time.Time, lastMsgKey *waCommon.MessageKey) error
Upload(ctx context.Context, data []byte, mediaType whatsmeow.MediaType) (whatsmeow.UploadResponse, error)
UploadNewsletter(ctx context.Context, data []byte, mediaType whatsmeow.MediaType) (whatsmeow.UploadResponse, error)
DownloadMediaToFile(ctx context.Context, directPath string, encFileHash, fileHash, mediaKey []byte, fileLength uint64, mediaType, mmsType string, targetPath string) (int64, error)
SendChatPresence(ctx context.Context, jid types.JID, state types.ChatPresence, media types.ChatPresenceMedia) error
ParseWebMessage(chatJID types.JID, webMsg *waWeb.WebMessageInfo) (*events.Message, error)
DecryptReaction(ctx context.Context, reaction *events.Message) (*waProto.ReactionMessage, error)
SetManualHistorySyncDownload(enabled bool)
DownloadHistorySync(ctx context.Context, notif *waE2E.HistorySyncNotification) (*waHistorySync.HistorySync, error)
DeleteHistorySyncMedia(ctx context.Context, notif *waE2E.HistorySyncNotification) error
RequestHistorySyncOnDemand(ctx context.Context, lastKnown types.MessageInfo, count int) (types.MessageID, error)
FetchAppState(ctx context.Context, name string, fullSync, onlyIfNotSynced bool) error
RequestAppStateRecovery(ctx context.Context, name string) (types.MessageID, error)
Logout(ctx context.Context) error
LinkedJID() string
SetProfilePicture(ctx context.Context, avatar []byte) (string, error)
}
Click to show internal directories.
Click to hide internal directories.