-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 belowCreate 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().imagestr - The image URL of the message. -
Message().videostr - The video URL of the message. -
Message().audiostr - The audio URL of the message. -
Message().documentstr - The document URL of the message. -
Message().locationstr - The location of the message. -
Message().interactivestr - 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