ModmailConversation

class praw.models.ModmailConversation(reddit, id=None, mark_read=False, _data=None)

A class for modmail conversations.

__init__(reddit, id=None, mark_read=False, _data=None)

Construct an instance of the ModmailConversation object.

Parameters:mark_read – If True, conversation is marked as read (default: False).
archive()

Archive the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').archive()
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.

highlight()

Highlight the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').highlight()
mute()

Mute the non-mod user associated with the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').mute()
classmethod parse(data, reddit, convert_objects=True)

Return an instance of ModmailConversation from data.

Parameters:
  • data – The structured data.
  • reddit – An instance of Reddit.
  • convert_objects – If True, convert message and mod action data into objects (default: True).
read(other_conversations=None)

Mark the conversation(s) as read.

Parameters:other_conversations – A list of other conversations to mark (default: None).

For example, to mark the conversation as read along with other recent conversations from the same user:

subreddit = reddit.subreddit('redditdev')
conversation = subreddit.modmail.conversation('2gmz')
conversation.read(
    other_conversations=conversation.user.recent_convos)
reply(body, author_hidden=False, internal=False)

Reply to the conversation.

Parameters:
  • body – The markdown formatted content for a message.
  • author_hidden – When True, author is hidden from non-moderators (default: False).
  • internal – When True, message is a private moderator note, hidden from non-moderators (default: False).
Returns:

A ModmailMessage object for the newly created message.

For example, to reply to the non-mod user while hiding your username:

conversation = reddit.subreddit('redditdev').modmail('2gmz')
conversation.reply('Message body', author_hidden=True)

To create a private moderator note on the conversation:

conversation.reply('Message body', internal=True)
unarchive()

Unarchive the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').unarchive()
unhighlight()

Un-highlight the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').unhighlight()
unmute()

Unmute the non-mod user associated with the conversation.

Example:

reddit.subreddit('redditdev').modmail('2gmz').unmute()
unread(other_conversations=None)

Mark the conversation(s) as unread.

Parameters:other_conversations – A list of other conversations to mark (default: None).

For example, to mark the conversation as unread along with other recent conversations from the same user:

subreddit = reddit.subreddit('redditdev')
conversation = subreddit.modmail.conversation('2gmz')
conversation.unread(
    other_conversations=conversation.user.recent_convos)

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.