Message¶
This section describes the usage and members of the Message model.
Messages are the private messages sent and received via the old Reddit private messaging system and are conventionally retrieved through the inbox:
async for message in reddit.user.inbox.unread():
print(message)
- class apraw.models.Message(reddit: Reddit, data: Dict[str, Any])¶
The model representing comments.
Typical Attributes
This table describes attributes that typically belong to objects of this class. Attributes are dynamically provided by the
aPRAWBaseclass and may vary depending on the status of the response and expected objects.Attribute
Description
first_messageThe first message sent in the message thread if the current message wasn’t the first.
first_message_nameThe fullname of the first message in the message thread if applicable.
subredditThe subreddit this conversation is being held in if applicable.
likesNonerepliesA list of all the message replies if applicable, otherwise an empty string.
idThe message ID.
subjectThe subject of this message’s thread.
associated_awarding_idThe ID of the associated awarding if the message was sent in the context of an award.
score0authorThe username of the message’s author.
num_commentsThe number of comments in this message’s thread.
parent_idNonesubreddit_name_prefixedThe prefixed name of the subreddit this conversation is being held in if applicable.
newbooltypestrbodyThe markdown string contents of this message.
destThe recipient of the message.
body_htmlThe HTML string contents of this message.
was_commentWhether this message was a comment.
nameThe fullname of this message, representing the ID prefixed with its kind. (e.g. t4_)
createdThe timestamp on which this message was created.
created_utcThe parsed UTC
datetimeon which this message was created.contextstrdistinguishedThe type of distinguishment on this message object.
- async author() apraw.models.reddit.redditor.Redditor¶
Retrieve the item’s author as a
Redditor.- Returns
author – The item’s author.
- Return type
- async fetch()¶
Fetch this item’s information from a suitable API endpoint.
- Returns
self – The updated model.
- Return type
- property fullname¶
Get the ID prepended with its kind.
- Returns
fullname – The item’s ID prepended with its kind such as t1_.
- Return type
str