Subreddit Modmail¶
This section details the usage of models related to subreddit modmail.
ModmailMessage¶
-
class
apraw.models.ModmailMessage(conversation: apraw.models.modmail.ModmailConversation, data: Dict)¶ The model for modmail messages.
- conversation: ModmailConversation
- The
ModmailConversationinstance this message belongs to. - data: Dict
- The data obtained from the API.
- id: str
- The ID of this message.
- body: str
- The HTML body of this message.
- body_md: str
- The raw body of this message.
- is_internal: str
- Whether the message was sent internally.
- date: str
- A timestamp on which the message was sent.
Note
ModmailMessageattributes are loaded statically, meaning they will always be present under the abovementioned names.
SubredditModmail¶
-
class
apraw.models.SubredditModmail(subreddit: Subreddit)¶ Helper class to aid in retrieving subreddit modmail.
- subreddit: Subreddit
- The subreddit this helper operates under.
-
conversations() → apraw.models.modmail.ModmailConversation¶ Retrieve a list of modmail conversations.
Yields: conversation (ModmailConversation) – A modmail conversation held in the subreddit.
ModmailConversation¶
-
class
apraw.models.ModmailConversation(reddit: Reddit, data: Dict, owner: Subreddit = None)¶ The model for modmail conversations.
- reddit: Reddit
- The
Redditinstance with which requests are made. - data: Dict
- The data obtained from the /about endpoint.
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 isAutoboolobjIdsA list of dictionaries containing the objects with their IDs and keys. isRepliableWhether the conversation can be replied to. lastUserUpdateA timestamp of the last user update or None.isInternalWhether it’s an internal mod conversation. lastModUpdateA timestamp of the last moderator update or None.lastUpdatedA timestamp of the last update made overall. authorsA list of dictionaries containing authors by name with additional meta information such as isMod,isAdmin,isOp,isParticipant,isHidden,id,isDeleted.ownerA dictionary describing the subreddit this conversation is held in. idThe ID of this conversation. isHighlightedWhether the conversation has been highlighted. subjectThe subject of this conversation. participantDictstateintlastUnreadNonenumMessagesThe number of messages in this conversation. -
full_data() → Dict¶ Retrieve the raw full data from the
/api/mod/conversations/{id}endpoint.Returns: full_data – The full data retrieved from the endpoint. Return type: Dict
-
messages() → apraw.models.modmail.ModmailMessage¶ Retrieve the messages sent in this conversation.
Yields: message (ModmailMessage) – A message sent in this conversation.