Categorygithub.com/insomnius/whatsmeow
modulepackage
0.0.0-20221222071518-e03eb42e21a9
Repository: https://github.com/insomnius/whatsmeow.git
Documentation: pkg.go.dev

# README

whatsmeow

Go Reference

whatsmeow is a Go library for the WhatsApp web multidevice API.

Discussion

Matrix room: #whatsmeow:maunium.net

For questions about the WhatsApp protocol (like how to send a specific type of message), you can also use the WhatsApp protocol Q&A section on GitHub discussions.

Usage

The godoc includes docs for all methods and event types. There's also a simple example at the top.

Also see mdtest for a CLI tool you can easily try out whatsmeow with.

Features

Most core features are already present:

  • Sending messages to private chats and groups (both text and media)
  • Receiving all messages
  • Managing groups and receiving group change events
  • Joining via invite messages, using and creating invite links
  • Sending and receiving typing notifications
  • Sending and receiving delivery and read receipts
  • Reading app state (contact list, chat pin/mute status, etc)
  • Sending and handling retry receipts if message decryption fails
  • Sending status messages (experimental, may not work for large contact lists)

Things that are not yet implemented:

  • Writing app state (contact list, chat pin/mute status, etc)
  • Sending broadcast list messages (this is not supported on WhatsApp web either)
  • Calls

# Packages

Package appstate implements encoding and decoding WhatsApp's app state patches.
Package binary implements encoding and decoding documents in WhatsApp's binary XML format.
Package socket implements a subset of the Noise protocol framework on top of websockets as used by WhatsApp.
Package store contains interfaces for storing data needed for WhatsApp multidevice.
Package types contains various structs and other types used by whatsmeow.
No description provided by the author

# Functions

CheckUpdate asks the WhatsApp servers if there is an update available.
DecryptMediaRetryNotification decrypts a media retry notification using the media key.
GenerateMessageID generates a random string that can be used as a message ID on WhatsApp.
GetMediaType returns the MediaType value corresponding to the given protobuf message.
HashPollOptions hashes poll option names using SHA-256 for voting.
NewClient initializes a new WhatsApp web client.
ParseDisappearingTimerString parses common human-readable disappearing message timer strings into Duration values.

# Constants

No description provided by the author
No description provided by the author
CheckUpdateURL is the base URL to check for WhatsApp web updates.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The known media types.
The known media types.
The known media types.
The known media types.
The known media types.
The known media types.
The known media types.
MinPreKeyCount is the number of prekeys when the client will upload a new batch of prekeys to the WhatsApp servers.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WantedPreKeyCount is the number of prekeys that the client should upload to the WhatsApp servers in a single batch.

# Variables

No description provided by the author
Miscellaneous errors.
Some errors that Client.SendMessage can return.
ErrBusinessMessageLinkNotFound is returned by ResolveBusinessMessageLink if the link doesn't exist or has been revoked.
ErrContactQRLinkNotFound is returned by ResolveContactQRLink if the link doesn't exist or has been revoked.
Some errors that Client.Download can return.
ErrGroupInviteLinkUnauthorized is returned by GetGroupInviteLink if you don't have the permission to get the link (status code 401).
ErrGroupNotFound is returned by group info getting methods if the group doesn't exist (status code 404).
ErrInvalidDisappearingTimer is returned by SetDisappearingTimer if the given timer is not one of the allowed values.
ErrInvalidImageFormat is returned by SetGroupPhoto if the given photo is not in the correct format.
Some errors that Client.Download can return.
Some errors that Client.Download can return.
Some errors that Client.Download can return.
ErrInviteLinkInvalid is returned by methods that use group invite links if the invite link is malformed.
ErrInviteLinkRevoked is returned by methods that use group invite links if the invite link was valid, but has been revoked and can no longer be used.
Common errors returned by info queries for use with errors.Is.
No description provided by the author
Common errors returned by info queries for use with errors.Is.
Common errors returned by info queries for use with errors.Is.
Common errors returned by info queries for use with errors.Is.
Common errors returned by info queries for use with errors.Is.
Common errors returned by info queries for use with errors.Is.
Miscellaneous errors.
Some errors that Client.Download can return.
Some errors that Client.Download can return.
ErrMediaNotAvailableOnPhone is returned by DecryptMediaRetryNotification if the given event contains error code 2.
Miscellaneous errors.
Miscellaneous errors.
Miscellaneous errors.
Miscellaneous errors.
No description provided by the author
Some errors that Client.Download can return.
ErrNotInGroup is returned by group info getting methods if you're not in the group (status code 403).
Miscellaneous errors.
No description provided by the author
Some errors that Client.Download can return.
No description provided by the author
ErrProfilePictureNotSet is returned by GetProfilePictureInfo when the given user or group doesn't have a profile picture (status code 404).
ErrProfilePictureUnauthorized is returned by GetProfilePictureInfo when trying to get the profile picture of a user whose privacy settings prevent you from seeing their profile picture (status code 401).
Miscellaneous errors.
Miscellaneous errors.
Some errors that Client.SendMessage can return.
Some errors that Client.Download can return.
ErrUnknownMediaRetryError is returned by DecryptMediaRetryNotification if the given event contains an unknown error code.
Some errors that Client.Download can return.
Some errors that Client.SendMessage can return.
KeepAliveIntervalMax specifies the maximum interval for websocket keepalive pings.
KeepAliveIntervalMin specifies the minimum interval for websocket keepalive pings.
KeepAliveResponseDeadline specifies the duration to wait for a response to websocket keepalive pings.
QRChannelClientOutdated is emitted from GetQRChannel if events.ClientOutdated is received.
QRChannelErrUnexpectedEvent is emitted from GetQRChannel if an unexpected connection event is received, as that likely means that the pairing has already happened before the channel was set up.
QRChannelScannedWithoutMultidevice is emitted from GetQRChannel if events.QRScannedWithoutMultidevice is received.
QRChannelSuccess is emitted from GetQRChannel when the pairing is successful.
QRChannelTimeout is emitted from GetQRChannel if the socket gets disconnected by the server before the pairing is successful.

# Structs

CheckUpdateResponse is the data returned by CheckUpdate.
Client contains everything necessary to connect to and interact with the WhatsApp web API.
No description provided by the author
DisconnectedError is returned if the websocket disconnects before an info query or other request gets a response.
ElementMissingError is returned by various functions that parse XML elements when a required element is missing.
No description provided by the author
IQError is a generic error container for info queries.
MediaConn contains a list of WhatsApp servers from which attachments can be downloaded from.
MediaConnHost represents a single host to download media from.
No description provided by the author
No description provided by the author
RecentMessage contains the info needed to re-send a message when another device fails to decrypt it.
ReqCreateGroup contains the request data for CreateGroup.
No description provided by the author
UploadResponse contains the data from the attachment upload, which can be put into a message to send the attachment.

# Interfaces

DownloadableMessage represents a protobuf message that contains attachment info.
DownloadableThumbnail represents a protobuf message that contains a thumbnail attachment.

# Type aliases

No description provided by the author
No description provided by the author
EventHandler is a function that can handle events from WhatsApp.
MediaType represents a type of uploaded file on WhatsApp.
No description provided by the author
No description provided by the author