Message

class praw.models.Message(reddit, _data)

A class for private messages.

__init__(reddit, _data)

Construct an instance of the Message object.

block()

Block the user who sent the item.

collapse()

Mark the item as collapsed.

Note

This method pertains only to objects which were retrieved via the inbox.

delete()

Delete the message.

Note

Reddit does not return an indication of whether or not the message was successfully deleted.

fullname

Return the object’s fullname.

A fullname is an object’s kind mapping like t3 followed by an underscore and the object’s base36 ID, e.g., t1_c5s96e0.

mark_read()

Mark the item as read.

Note

This method pertains only to objects which were retrieved via the inbox.

mark_unread()

Mark the item as unread.

Note

This method pertains only to objects which were retrieved via the inbox.

classmethod parse(data, reddit)

Return an instance of Message or SubredditMessage from data.

Parameters:
  • data – The structured data.
  • reddit – An instance of Reddit.
reply(body)

Reply to the object.

Parameters:body – The markdown formatted content for a comment.
Returns:A Comment object for the newly created comment.
uncollapse()

Mark the item as uncollapsed.

Note

This method pertains only to objects which were retrieved via the inbox.

Note

This list of attributes is not complete. PRAW dynamically provides the attributes that Reddit returns via the API. Because those attributes are subject to change on Reddit’s end, PRAW makes no effort to document them, other than to instruct you on how to discover what is available. See Determine Available Attributes of an Object for detailed information.