You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i cannot figure out how to get messages from group.
I have checked the docs and all I can find is the get_newsletter_messages() function, but I cannot understand how to find the “before” argument, and what the function expects.
Docs says the before argument is optional, but I get the following
error: An unexpected error occurred while retrieving messages: argument 5: TypeError: 'NoneType' object cannot be interpreted as an integer
Could you tell me if I’m correctly using this function? If not, what’s the best function to get messages from WhatsApp groups?
def get_newsletter_message_update(
self, jid: JID, count: int, since: int, after: int
) -> RepeatedCompositeFieldContainer[NewsletterMessage]:
"""Retrieves a list of newsletter messages that have been updated since a given timestamp.
:param jid: The JID (Jabber ID) of the user.
:type jid: JID
:param count: The maximum number of messages to retrieve.
:type count: int
:param since: The timestamp (in milliseconds) to retrieve messages from.
:type since: int
:param after: The timestamp (in milliseconds) to retrieve messages after.
:type after: int
:return: A list of updated newsletter messages.
:rtype: RepeatedCompositeFieldContainer[NewsletterMessage]
:raises GetNewsletterMessageUpdateError: If there was an error retrieving the newsletter messages.
"""
jidbyte = jid.SerializeToString()
model = neonize_proto.GetNewsletterMessageUpdateReturnFunction.FromString(
self.__client.GetNewsletterMessageUpdate(
self.uuid, jidbyte, len(jidbyte), count, since, after
).get_bytes()
)
if model.Error:
raise GetNewsletterMessageUpdateError(model.Error)
return model.NewsletterMessage
get_newsletter_messages(jid, count, before)
Retrieves a list of newsletter messages for a given JID.
Parameters:
jid (JID) – The JID (Jabber Identifier) of the user.
count (int) – The maximum number of messages to retrieve.
before (MessageServerID) – The ID of the message before which to retrieve messages.
Hi, i cannot figure out how to get messages from group.
I have checked the docs and all I can find is the get_newsletter_messages() function, but I cannot understand how to find the “before” argument, and what the function expects.
Docs says the before argument is optional, but I get the following
error: An unexpected error occurred while retrieving messages: argument 5: TypeError: 'NoneType' object cannot be interpreted as an integer
Could you tell me if I’m correctly using this function? If not, what’s the best function to get messages from WhatsApp groups?
get_newsletter_messages(jid, count, before)
Retrieves a list of newsletter messages for a given JID.
Parameters:
jid (JID) – The JID (Jabber Identifier) of the user.
count (int) – The maximum number of messages to retrieve.
before (MessageServerID) – The ID of the message before which to retrieve messages.
Returns:
A list of newsletter messages.
Return type:
RepeatedCompositeFieldContaine[NewsletterMessage]
The text was updated successfully, but these errors were encountered: