-
-
Notifications
You must be signed in to change notification settings - Fork 18
Message() Object
Filippo Romani edited this page Apr 15, 2023
·
2 revisions
You can use the Message
object to easily interact with messages. For example, you can reply to a message using the reply
method.
message = Message(instance=yourclient, id="MESSAGEID") # this is your message instance
message.reply("Hello world!")
You can also create a message object using the WhatsApp
class. This method doesn't require to pass the instance
parameter.
message = yourclient.create_message(args) # args are described below
Create a new message object.
Reply to a message. Required Message() initialization parameters:
- instance
- id
Send a message. Required Message() initialization parameters:
- instance
- to
- content
Mark a message as read. Required Message() initialization parameters:
- instance
- id
-
Message().image
str - The image URL of the message. -
Message().video
str - The video URL of the message. -
Message().audio
str - The audio URL of the message. -
Message().document
str - The document URL of the message. -
Message().location
str - The location of the message. -
Message().interactive
str - The interactive reply of the message.
Each of these properties will return None
if the message does not contain the specified content.
If you find any issue in the docs, please open an issue/pr and report it