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
ModmailConversation
instance 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
ModmailMessage
attributes 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
Reddit
instance 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
aPRAWBase
class and may vary depending on the status of the response and expected objects.Attribute Description isAuto
bool
objIds
A list of dictionaries containing the objects with their IDs and keys. isRepliable
Whether the conversation can be replied to. lastUserUpdate
A timestamp of the last user update or None
.isInternal
Whether it’s an internal mod conversation. lastModUpdate
A timestamp of the last moderator update or None
.lastUpdated
A timestamp of the last update made overall. authors
A list of dictionaries containing authors by name with additional meta information such as isMod
,isAdmin
,isOp
,isParticipant
,isHidden
,id
,isDeleted
.owner
A dictionary describing the subreddit this conversation is held in. id
The ID of this conversation. isHighlighted
Whether the conversation has been highlighted. subject
The subject of this conversation. participant
Dict
state
int
lastUnread
None
numMessages
The 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.