slidge_whatsapp.generated.whatsapp#
Attributes#
The call states handled by the overarching session event handler. |
|
The call states handled by the overarching session event handler. |
|
The call states handled by the overarching session event handler. |
|
The chat states handled by the overarching session event handler. |
|
The chat states handled by the overarching session event handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The event types handled by the overarching session adapter handler. |
|
The log levels handled by the overarching Session logger. |
|
The log levels handled by the overarching Session logger. |
|
The log levels handled by the overarching Session logger. |
|
The log levels handled by the overarching Session logger. |
|
The message types handled by the overarching session event handler. |
|
The message types handled by the overarching session event handler. |
|
The message types handled by the overarching session event handler. |
|
The message types handled by the overarching session event handler. |
|
The message types handled by the overarching session event handler. |
|
The presences handled by the overarching session event handler. |
|
The presences handled by the overarching session event handler. |
|
The delivery receipts handled by the overarching session event handler. |
|
The delivery receipts handled by the overarching session event handler. |
|
Classes#
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
GoClass is the base class for all GoPy wrapper classes |
|
CallState represents the state of the call to synchronize with. |
|
ChatStateKind represents the different kinds of chat-states possible in WhatsApp. |
|
EventKind represents all event types recognized by the Python session adapter, as emitted by the |
|
GroupAffiliation represents the set of privilidges given to a specific participant in a group. |
|
GroupParticipantAction represents the distinct set of actions that can be taken when encountering |
|
A ErrorLevel is a value representing the severity of a log message being handled. |
|
MessageKind represents all concrete message types (plain-text messages, edit messages, reactions) |
|
PresenceKind represents the different kinds of activity states possible in WhatsApp. |
|
ReceiptKind represents the different types of delivery receipts possible in WhatsApp. |
|
A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside |
|
A Group represents a named, many-to-many chat space which may be joined or left at will. All |
|
A Preview represents a short description for a URL provided in a message body, as usually derived |
|
A Contact represents any entity that be communicated with directly in WhatsApp. This typically |
|
EventPayload represents the collected payloads for all event types handled by the overarching |
|
A GroupSubject represents the user-defined group description and attached metadata thereof, for a |
|
A LinkedDevice represents a unique pairing session between the gateway and WhatsApp. It is not |
|
A Location represents additional metadata given to location messages. |
|
A Message represents one of many kinds of bidirectional communication payloads, for example, a |
|
Precence represents a contact's general state of activity, and is periodically updated as |
|
A Session represents a connection (active or not) between a linked device and WhatsApp. Active |
|
A Avatar represents a small image set for a Contact or Group. |
|
A ChatState represents the activity of a contact within a certain discussion, for instance, |
|
A GroupParticipant represents a contact who is currently joined in a given group. Participants in |
|
A Call represents an incoming or outgoing voice/video call made over WhatsApp. Full support for |
|
A Gateway represents a persistent process for establishing individual sessions between linked |
|
A Receipt represents a notice of delivery or presentation for [Message] instances sent or |
Functions#
NewGateway() object |
Module Contents#
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_Attachment(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_Contact(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_Group(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_GroupParticipant(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_Message(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_whatsapp_Receipt(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_types_GroupParticipant(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.Slice_interface_(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
GoClass is the base class for all GoPy wrapper classes
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameter is a python list that we copy from
- class slidge_whatsapp.generated.whatsapp.CallState(*args, **kwds)[source]#
Bases:
enum.Enum
CallState represents the state of the call to synchronize with.
- slidge_whatsapp.generated.whatsapp.CallUnknown = 0[source]#
The call states handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.CallIncoming = 1[source]#
The call states handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.CallMissed = 2[source]#
The call states handled by the overarching session event handler.
- class slidge_whatsapp.generated.whatsapp.ChatStateKind(*args, **kwds)[source]#
Bases:
enum.Enum
ChatStateKind represents the different kinds of chat-states possible in WhatsApp.
- slidge_whatsapp.generated.whatsapp.ChatStateComposing = 1[source]#
The chat states handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.ChatStatePaused = 2[source]#
The chat states handled by the overarching session event handler.
- class slidge_whatsapp.generated.whatsapp.EventKind(*args, **kwds)[source]#
Bases:
enum.Enum
EventKind represents all event types recognized by the Python session adapter, as emitted by the Go session adapter.
- slidge_whatsapp.generated.whatsapp.EventUnknown = 0[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventQRCode = 1[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventPair = 2[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventConnected = 3[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventLoggedOut = 4[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventContact = 5[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventPresence = 6[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventMessage = 7[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventChatState = 8[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventReceipt = 9[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventGroup = 10[source]#
The event types handled by the overarching session adapter handler.
- slidge_whatsapp.generated.whatsapp.EventCall = 11[source]#
The event types handled by the overarching session adapter handler.
- class slidge_whatsapp.generated.whatsapp.GroupAffiliation(*args, **kwds)[source]#
Bases:
enum.Enum
GroupAffiliation represents the set of privilidges given to a specific participant in a group.
- class slidge_whatsapp.generated.whatsapp.GroupParticipantAction(*args, **kwds)[source]#
Bases:
enum.Enum
GroupParticipantAction represents the distinct set of actions that can be taken when encountering a group participant, typically to add or remove.
- class slidge_whatsapp.generated.whatsapp.ErrorLevel(*args, **kwds)[source]#
Bases:
enum.Enum
A ErrorLevel is a value representing the severity of a log message being handled.
- slidge_whatsapp.generated.whatsapp.LevelError = 1[source]#
The log levels handled by the overarching Session logger.
- slidge_whatsapp.generated.whatsapp.LevelWarning = 2[source]#
The log levels handled by the overarching Session logger.
- slidge_whatsapp.generated.whatsapp.LevelInfo = 3[source]#
The log levels handled by the overarching Session logger.
- slidge_whatsapp.generated.whatsapp.LevelDebug = 4[source]#
The log levels handled by the overarching Session logger.
- class slidge_whatsapp.generated.whatsapp.MessageKind(*args, **kwds)[source]#
Bases:
enum.Enum
MessageKind represents all concrete message types (plain-text messages, edit messages, reactions) recognized by the Python session adapter.
- slidge_whatsapp.generated.whatsapp.MessagePlain = 1[source]#
The message types handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.MessageEdit = 2[source]#
The message types handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.MessageRevoke = 3[source]#
The message types handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.MessageReaction = 4[source]#
The message types handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.MessageAttachment = 5[source]#
The message types handled by the overarching session event handler.
- class slidge_whatsapp.generated.whatsapp.PresenceKind(*args, **kwds)[source]#
Bases:
enum.Enum
PresenceKind represents the different kinds of activity states possible in WhatsApp.
The presences handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.PresenceAvailable = 1[source]#
The presences handled by the overarching session event handler.
The presences handled by the overarching session event handler.
- class slidge_whatsapp.generated.whatsapp.ReceiptKind(*args, **kwds)[source]#
Bases:
enum.Enum
ReceiptKind represents the different types of delivery receipts possible in WhatsApp.
- slidge_whatsapp.generated.whatsapp.ReceiptDelivered = 1[source]#
The delivery receipts handled by the overarching session event handler.
- slidge_whatsapp.generated.whatsapp.ReceiptRead = 2[source]#
The delivery receipts handled by the overarching session event handler.
- class slidge_whatsapp.generated.whatsapp.Attachment(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside a message, for display or storage on the recepient client.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Group(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Group represents a named, many-to-many chat space which may be joined or left at will. All fields apart from the group JID are considered to be optional, and may not be set in cases where group information is being updated against previous assumed state. Groups in WhatsApp are generally invited to out-of-band with respect to overarching adaptor; see the documentation for [Session.GetGroups] for more information.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Preview(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Preview represents a short description for a URL provided in a message body, as usually derived from the content of the page pointed at.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Contact(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Contact represents any entity that be communicated with directly in WhatsApp. This typically represents people, but may represent a business or bot as well, but not a group-chat.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.EventPayload(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
EventPayload represents the collected payloads for all event types handled by the overarching session adapter handler. Only specific fields will be populated in events emitted by internal handlers, see documentation for specific types for more information.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.GroupSubject(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A GroupSubject represents the user-defined group description and attached metadata thereof, for a given [Group].
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.LinkedDevice(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A LinkedDevice represents a unique pairing session between the gateway and WhatsApp. It is not unique to the underlying “main” device (or phone number), as multiple linked devices may be paired with any main device.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Location(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Location represents additional metadata given to location messages.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Message(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Message represents one of many kinds of bidirectional communication payloads, for example, a text message, a file (image, video) attachment, an emoji reaction, etc. Messages of different kinds are denoted as such, and re-use fields where the semantics overlap.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Presence(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
Precence represents a contact’s general state of activity, and is periodically updated as contacts start or stop paying attention to their client of choice.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Session(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Session represents a connection (active or not) between a linked device and WhatsApp. Active sessions need to be established by logging in, after which incoming events will be forwarded to the adapter event handler, and outgoing events will be forwarded to WhatsApp.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- Login()[source]#
Login() str
Login attempts to authenticate the given [Session], either by re-using the [LinkedDevice] attached or by initiating a pairing session for a new linked device. Callers are expected to have set an event handler in order to receive any incoming events from the underlying WhatsApp session.
- Logout()[source]#
Logout() str
Logout disconnects and removes the current linked device locally and initiates a logout remotely.
- Disconnect()[source]#
Disconnect() str
Disconnects detaches the current connection to WhatsApp without removing any linked device state.
- PairPhone(phone)[source]#
PairPhone(str phone) str, str
PairPhone returns a one-time code from WhatsApp, used for pairing this [Session] against the user’s primary device, as identified by the given phone number. This will return an error if the [Session] is already paired, or if the phone number given is empty or invalid.
- SendMessage(message)[source]#
SendMessage(object message) str
SendMessage processes the given Message and sends a WhatsApp message for the kind and contact JID specified within. In general, different message kinds require different fields to be set; see the documentation for the [Message] type for more information.
- GenerateMessageID()[source]#
GenerateMessageID() str
GenerateMessageID returns a valid, pseudo-random message ID for use in outgoing messages.
- SendChatState(state)[source]#
SendChatState(object state) str
SendChatState sends the given chat state notification (e.g. composing message) to WhatsApp for the contact specified within.
- SendReceipt(receipt)[source]#
SendReceipt(object receipt) str
SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
- SendPresence(presence, statusMessage)[source]#
SendPresence(int presence, str statusMessage) str
SendPresence sets the activity state and (optional) status message for the current session and user. An error is returned if setting availability fails for any reason.
- GetContacts(refresh)[source]#
GetContacts(bool refresh) []object, str
GetContacts subscribes to the WhatsApp roster currently stored in the Session’s internal state. If refresh is true, FetchRoster will pull application state from the remote service and synchronize any contacts found with the adapter.
- GetGroups()[source]#
GetGroups() []object, str
GetGroups returns a list of all group-chats currently joined in WhatsApp, along with additional information on present participants.
- CreateGroup(name, participants)[source]#
CreateGroup(str name, []str participants) object, str
CreateGroup attempts to create a new WhatsApp group for the given human-readable name and participant JIDs given.
- GetAvatar(resourceID, avatarID)[source]#
GetAvatar(str resourceID, str avatarID) object, str
GetAvatar fetches a profile picture for the Contact or Group JID given. If a non-empty avatarID is also given, GetAvatar will return an empty [Avatar] instance with no error if the remote state for the given ID has not changed.
- SetAvatar(resourceID, avatar)[source]#
SetAvatar(str resourceID, []int avatar) str, str
SetAvatar updates the profile picture for the Contact or Group JID given; it can also update the profile picture for our own user by providing an empty JID. The unique picture ID is returned, typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
- SetGroupName(resourceID, name)[source]#
SetGroupName(str resourceID, str name) str
SetGroupName updates the name of a WhatsApp group
- SetGroupTopic(resourceID, topic)[source]#
SetGroupTopic(str resourceID, str topic) str
SetGroupTopic updates the topic of a WhatsApp group
- SetAffiliation(groupID, participantID, change)[source]#
SetAffiliation(str groupID, str participantID, str change) []object, str
- FindContact(phone)[source]#
FindContact(str phone) object, str
FindContact attempts to check for a registered contact on WhatsApp corresponding to the given phone number, returning a concrete instance if found; typically, only the contact JID is set. No error is returned if no contact was found, but any unexpected errors will otherwise be returned directly.
- RequestMessageHistory(resourceID, oldestMessage)[source]#
RequestMessageHistory(str resourceID, object oldestMessage) str
RequestMessageHistory sends and asynchronous request for message history related to the given resource (e.g. Contact or Group JID), ending at the oldest message given. Messages returned from history should then be handled as a HistorySync event of type ON_DEMAND, in the session-wide event handler. An error will be returned if requesting history fails for any reason.
- SetEventHandler(h, goRun=False)[source]#
SetEventHandler(callable h)
SetEventHandler assigns the given handler function for propagating internal events into the Python gateway. Note that the event handler function is not entirely safe to use directly, and all calls should instead be made via the [propagateEvent] function.
- class slidge_whatsapp.generated.whatsapp.Avatar(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Avatar represents a small image set for a Contact or Group.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.ChatState(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A ChatState represents the activity of a contact within a certain discussion, for instance, whether the contact is currently composing a message. This is separate to the concept of a Presence, which is the contact’s general state across all discussions.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.GroupParticipant(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A GroupParticipant represents a contact who is currently joined in a given group. Participants in WhatsApp can always be derived back to their individual [Contact]; there are no anonymous groups in WhatsApp.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Call(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Call represents an incoming or outgoing voice/video call made over WhatsApp. Full support for calls is currently not implemented, and this structure contains the bare minimum data required for notifying on missed calls.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- class slidge_whatsapp.generated.whatsapp.Gateway(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Gateway represents a persistent process for establishing individual sessions between linked devices and WhatsApp.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first
- SetLogHandler(h, goRun=False)[source]#
SetLogHandler(callable h)
SetLogHandler specifies the log handling function to use for all [Gateway] and [Session] operations.
- Init()[source]#
Init() str
Init performs initialization procedures for the Gateway, and is expected to be run before any calls to [Gateway.Session].
- class slidge_whatsapp.generated.whatsapp.Receipt(*args, **kwargs)[source]#
Bases:
slidge_whatsapp.generated.go.GoClass
A Receipt represents a notice of delivery or presentation for [Message] instances sent or received. Receipts can be delivered for many messages at once, but are generally all delivered under one specific state at a time.
handle=A Go-side object is always initialized with an explicit handle=arg otherwise parameters can be unnamed in order of field names or named fields in which case a new Go object is constructed first