slidge_whatsapp.generated.whatsapp#

Attributes#

_collections_abc

cwd

currentdir

CallUnknown

The call states handled by the overarching session event handler.

CallIncoming

The call states handled by the overarching session event handler.

CallMissed

The call states handled by the overarching session event handler.

ChatStateComposing

The chat states handled by the overarching session event handler.

ChatStatePaused

The chat states handled by the overarching session event handler.

EventUnknown

The event types handled by the overarching session adapter handler.

EventQRCode

The event types handled by the overarching session adapter handler.

EventPair

The event types handled by the overarching session adapter handler.

EventConnected

The event types handled by the overarching session adapter handler.

EventLoggedOut

The event types handled by the overarching session adapter handler.

EventContact

The event types handled by the overarching session adapter handler.

EventPresence

The event types handled by the overarching session adapter handler.

EventMessage

The event types handled by the overarching session adapter handler.

EventChatState

The event types handled by the overarching session adapter handler.

EventReceipt

The event types handled by the overarching session adapter handler.

EventGroup

The event types handled by the overarching session adapter handler.

EventCall

The event types handled by the overarching session adapter handler.

GroupAffiliationNone

GroupAffiliationAdmin

GroupAffiliationOwner

GroupParticipantActionAdd

GroupParticipantActionUpdate

GroupParticipantActionRemove

LevelError

The log levels handled by the overarching Session logger.

LevelWarning

The log levels handled by the overarching Session logger.

LevelInfo

The log levels handled by the overarching Session logger.

LevelDebug

The log levels handled by the overarching Session logger.

MessagePlain

The message types handled by the overarching session event handler.

MessageEdit

The message types handled by the overarching session event handler.

MessageRevoke

The message types handled by the overarching session event handler.

MessageReaction

The message types handled by the overarching session event handler.

MessageAttachment

The message types handled by the overarching session event handler.

PresenceAvailable

The presences handled by the overarching session event handler.

PresenceUnavailable

The presences handled by the overarching session event handler.

ReceiptDelivered

The delivery receipts handled by the overarching session event handler.

ReceiptRead

The delivery receipts handled by the overarching session event handler.

DefaultGroupServer

DefaultUserServer

Classes#

Slice_whatsapp_Attachment

GoClass is the base class for all GoPy wrapper classes

Slice_whatsapp_Contact

GoClass is the base class for all GoPy wrapper classes

Slice_whatsapp_Group

GoClass is the base class for all GoPy wrapper classes

Slice_whatsapp_GroupParticipant

GoClass is the base class for all GoPy wrapper classes

Slice_whatsapp_Message

GoClass is the base class for all GoPy wrapper classes

Slice_whatsapp_Receipt

GoClass is the base class for all GoPy wrapper classes

Slice_types_GroupParticipant

GoClass is the base class for all GoPy wrapper classes

Slice_interface_

GoClass is the base class for all GoPy wrapper classes

CallState

CallState represents the state of the call to synchronize with.

ChatStateKind

ChatStateKind represents the different kinds of chat-states possible in WhatsApp.

EventKind

EventKind represents all event types recognized by the Python session adapter, as emitted by the

GroupAffiliation

GroupAffiliation represents the set of privilidges given to a specific participant in a group.

GroupParticipantAction

GroupParticipantAction represents the distinct set of actions that can be taken when encountering

ErrorLevel

A ErrorLevel is a value representing the severity of a log message being handled.

MessageKind

MessageKind represents all concrete message types (plain-text messages, edit messages, reactions)

PresenceKind

PresenceKind represents the different kinds of activity states possible in WhatsApp.

ReceiptKind

ReceiptKind represents the different types of delivery receipts possible in WhatsApp.

Attachment

A Attachment represents additional binary data (e.g. images, videos, documents) provided alongside

Group

A Group represents a named, many-to-many chat space which may be joined or left at will. All

Preview

A Preview represents a short description for a URL provided in a message body, as usually derived

Contact

A Contact represents any entity that be communicated with directly in WhatsApp. This typically

EventPayload

EventPayload represents the collected payloads for all event types handled by the overarching

GroupSubject

A GroupSubject represents the user-defined group description and attached metadata thereof, for a

LinkedDevice

A LinkedDevice represents a unique pairing session between the gateway and WhatsApp. It is not

Location

A Location represents additional metadata given to location messages.

Message

A Message represents one of many kinds of bidirectional communication payloads, for example, a

Presence

Precence represents a contact's general state of activity, and is periodically updated as

Session

A Session represents a connection (active or not) between a linked device and WhatsApp. Active

Avatar

A Avatar represents a small image set for a Contact or Group.

ChatState

A ChatState represents the activity of a contact within a certain discussion, for instance,

GroupParticipant

A GroupParticipant represents a contact who is currently joined in a given group. Participants in

Call

A Call represents an incoming or outgoing voice/video call made over WhatsApp. Full support for

Gateway

A Gateway represents a persistent process for establishing individual sessions between linked

Receipt

A Receipt represents a notice of delivery or presentation for [Message] instances sent or

Functions#

NewGateway()

NewGateway() object

Module Contents#

slidge_whatsapp.generated.whatsapp._collections_abc[source]#
slidge_whatsapp.generated.whatsapp.cwd[source]#
slidge_whatsapp.generated.whatsapp.currentdir[source]#
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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

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

index = 0[source]#
__del__()[source]#
__str__()[source]#
__repr__()[source]#
__len__()[source]#
__getitem__(key)[source]#
__setitem__(idx, value)[source]#
__iadd__(value)[source]#
__iter__()[source]#
__next__()[source]#
append(value)[source]#
copy(src)[source]#

copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list

class slidge_whatsapp.generated.whatsapp.CallState(*args, **kwds)[source]#

Bases: enum.Enum

CallState represents the state of the call to synchronize with.

CallUnknown = 0[source]#

The call states handled by the overarching session event handler.

CallIncoming = 1[source]#

The call states handled by the overarching session event handler.

CallMissed = 2[source]#

The call states handled by the overarching session event handler.

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.

ChatStateComposing = 1[source]#

The chat states handled by the overarching session event handler.

ChatStatePaused = 2[source]#

The chat states handled by the overarching session event handler.

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.

EventUnknown = 0[source]#

The event types handled by the overarching session adapter handler.

EventQRCode = 1[source]#

The event types handled by the overarching session adapter handler.

EventPair = 2[source]#

The event types handled by the overarching session adapter handler.

EventConnected = 3[source]#

The event types handled by the overarching session adapter handler.

EventLoggedOut = 4[source]#

The event types handled by the overarching session adapter handler.

EventContact = 5[source]#

The event types handled by the overarching session adapter handler.

EventPresence = 6[source]#

The event types handled by the overarching session adapter handler.

EventMessage = 7[source]#

The event types handled by the overarching session adapter handler.

EventChatState = 8[source]#

The event types handled by the overarching session adapter handler.

EventReceipt = 9[source]#

The event types handled by the overarching session adapter handler.

EventGroup = 10[source]#

The event types handled by the overarching session adapter handler.

EventCall = 11[source]#

The event types handled by the overarching session adapter handler.

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.

GroupAffiliationNone = 0[source]#
GroupAffiliationAdmin = 1[source]#
GroupAffiliationOwner = 2[source]#
slidge_whatsapp.generated.whatsapp.GroupAffiliationNone = 0[source]#
slidge_whatsapp.generated.whatsapp.GroupAffiliationAdmin = 1[source]#
slidge_whatsapp.generated.whatsapp.GroupAffiliationOwner = 2[source]#
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.

GroupParticipantActionAdd = 0[source]#
GroupParticipantActionUpdate = 1[source]#
GroupParticipantActionRemove = 2[source]#
slidge_whatsapp.generated.whatsapp.GroupParticipantActionAdd = 0[source]#
slidge_whatsapp.generated.whatsapp.GroupParticipantActionUpdate = 1[source]#
slidge_whatsapp.generated.whatsapp.GroupParticipantActionRemove = 2[source]#
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.

LevelError = 1[source]#

The log levels handled by the overarching Session logger.

LevelWarning = 2[source]#

The log levels handled by the overarching Session logger.

LevelInfo = 3[source]#

The log levels handled by the overarching Session logger.

LevelDebug = 4[source]#

The log levels handled by the overarching Session logger.

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.

MessagePlain = 1[source]#

The message types handled by the overarching session event handler.

MessageEdit = 2[source]#

The message types handled by the overarching session event handler.

MessageRevoke = 3[source]#

The message types handled by the overarching session event handler.

MessageReaction = 4[source]#

The message types handled by the overarching session event handler.

MessageAttachment = 5[source]#

The message types handled by the overarching session event handler.

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.

PresenceAvailable = 1[source]#

The presences handled by the overarching session event handler.

PresenceUnavailable = 2[source]#

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.

slidge_whatsapp.generated.whatsapp.PresenceUnavailable = 2[source]#

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.

ReceiptDelivered = 1[source]#

The delivery receipts handled by the overarching session event handler.

ReceiptRead = 2[source]#

The delivery receipts handled by the overarching session event handler.

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.

slidge_whatsapp.generated.whatsapp.DefaultGroupServer = 'g.us'[source]#
slidge_whatsapp.generated.whatsapp.DefaultUserServer = 's.whatsapp.net'[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property MIME[source]#
property Filename[source]#
property Caption[source]#
property Data[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property JID[source]#
property Name[source]#
property Subject[source]#
property Nickname[source]#
property Participants[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property URL[source]#
property Title[source]#
property Description[source]#
property Thumbnail[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property JID[source]#
property Name[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property QRCode[source]#
property PairDeviceID[source]#
property ConnectedJID[source]#
property Contact[source]#
property Presence[source]#
property Message[source]#
property ChatState[source]#
property Receipt[source]#
property Group[source]#
property Call[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property Subject[source]#
property SetAt[source]#
property SetByJID[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property ID[source]#
ID is an opaque string identifying this LinkedDevice to the Session. Noted that this string
is currently equivalent to a password, and needs to be protected accordingly.
JID()[source]#

JID() object

JID returns the WhatsApp JID corresponding to the LinkedDevice ID. Empty or invalid device IDs may return invalid JIDs, and this function does not handle errors.

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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property Latitude[source]#
property Longitude[source]#
property Accuracy[source]#
property IsLive[source]#
property Name[source]#
Optional fields given for named locations.
property Address[source]#
property URL[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property Kind[source]#
property ID[source]#
property JID[source]#
property GroupJID[source]#
property OriginJID[source]#
property Body[source]#
property Timestamp[source]#
property IsCarbon[source]#
property ReplyID[source]#
property ReplyBody[source]#
property Attachments[source]#
property Preview[source]#
property Location[source]#
property MentionJIDs[source]#
property Receipts[source]#
property Reactions[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property JID[source]#
property Kind[source]#
property LastSeen[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property ID[source]#
property URL[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property Kind[source]#
property JID[source]#
property GroupJID[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property JID[source]#
property Affiliation[source]#
property Action[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property State[source]#
property JID[source]#
property Timestamp[source]#
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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property DBPath[source]#
property Name[source]#
property TempDir[source]#
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].

NewSession(device)[source]#

NewSession(object device) object

NewSession returns a new [Session] for the LinkedDevice given. If the linked device does not have a valid ID, a pair operation will be required, as described in [Session.Login].

CleanupSession(device)[source]#

CleanupSession(object device) str

CleanupSession will remove all invalid and obsolete references to the given device, and should be used when pairing a new device or unregistering from the Gateway.

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

__del__()[source]#
__str__()[source]#
__repr__()[source]#
property Kind[source]#
property MessageIDs[source]#
property JID[source]#
property GroupJID[source]#
property Timestamp[source]#
property IsCarbon[source]#
slidge_whatsapp.generated.whatsapp.NewGateway()[source]#

NewGateway() object

NewGateway returns a new, un-initialized Gateway. This function should always be followed by calls to [Gateway.Init], assuming a valid [Gateway.DBPath] is set.