redditwarp.models.modmail#

class redditwarp.models.modmail.ConversationProgress(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: IntEnum

NEW = 0#
IN_PROGRESS = 1#
ARCHIVED = 2#
class redditwarp.models.modmail.ModActionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: IntEnum

HIGHLIGHT = 0#
UNHIGHLIGHT = 1#
ARCHIVE = 2#
UNARCHIVE = 3#
MUTE_USER = 5#
UNMUTE_USER = 6#
BAN_USER = 7#
UNBAN_USER = 8#
APPROVE_USER = 9#
DISAPPROVE_USER = 10#
class redditwarp.models.modmail.ModmailSubreddit(d: 'Mapping[str, Any]', id: 'int', name: 'str', subscriber_count: 'int')[source]#

Bases: DatamementoPropertiesMixin

d: Mapping[str, Any]#
id: int#
name: str#
subscriber_count: int#
class redditwarp.models.modmail.ConversationInfo(d: Mapping[str, Any])[source]#

Bases: DatamementoPropertiesMixin

class LegacyMessage(idn: 'int', id36: 'str', link: 'str')[source]#

Bases: object

idn: int#
id36: str#
class Participant(d: 'Mapping[str, Any]', idn: 'int', id36: 'str', name: 'str', is_admin: 'bool', is_op: 'bool', is_approved: 'bool')[source]#

Bases: object

d: Mapping[str, Any]#
idn: int#
id36: str#
name: str#
is_admin: bool#
is_op: bool#
is_approved: bool#
class ParticipantSubreddit(d: 'Mapping[str, Any]', idn: 'int', id36: 'str', name: 'str')[source]#

Bases: object

d: Mapping[str, Any]#
idn: int#
id36: str#
name: str#
d: Mapping[str, Any]#
id36: str#
idn: int#
id: int#
subject: str#
progress: int#

Enum: ConversationProgress

message_count: int#

Number of messages in the conversation.

auto: bool#

True if the conversation was created due to an automated message; false if the message was created by a user.

internal: bool#

Whether this conversation is a moderator discussion.

repliable: bool#

True if the conversation thread accepts replies.

highlighted: bool#

True if the conversation is highlighted.

legacy_message: LegacyMessage | None#

Object that contains an ID that refers to the first message in the legacy modmail thread for this conversation thread.

The underlying data can be null in rare cases, such as in the “r/{subreddit} is now enrolled in the New Modmail” modmail message from u/reddit.

last_updated_by_user_at: datetime | None#

If internal is true this should always be null.

last_updated_by_mod_at: datetime | None#
last_updated_at: datetime#

Same as either last_updated_by_user_at or last_updated_by_mod_at, whichever is newer.

last_unread: datetime | None#

Datetime of when the conversation was last marked unread.

subreddit_name: str#

Name of the subreddit associated with this conversation.

subreddit_id: int#

ID of the subreddit associated with this conversation.

participant: Participant | None#

The target user of this conversation.

Value None if this conversation is a moderator discussion (i.e., internal is true), or if it is a to-subreddit conversation from the perspective of a user.

participant_subreddit: ParticipantSubreddit | None#

Information about the relevant subreddit, if applicable.

Value None if this conversation is a moderator discussion (i.e., internal is true), or if the modmail conversation was initiated directly from a user.

class redditwarp.models.modmail.Message(d: Mapping[str, Any])[source]#

Bases: DatamementoPropertiesMixin

d: Mapping[str, Any]#
id36: str#
idn: int#
id: int#
author_name: str#

User name of the author of the message.

Unknown what happens if the user is deleted. Is the value [deleted], an empty string, or does the field in the underlying object not exist? If you have any information about this, please open an issue report at https://github.com/Pyprohly/redditwarp/issues.

author_id: int#

User ID of the author of the message.

Unknown what happens if the user is deleted. If you have any information about this, please open an issue report at https://github.com/Pyprohly/redditwarp/issues.

body: str#

Text content of the message in markdown format.

body_html: str#

Content of the message in HTML.

datetime: datetime#

Datetime object of when the message was created.

internal: bool#

Always true if this message is in a moderator discussion. Otherwise, true if this message is a private moderator note.

class redditwarp.models.modmail.ModAction(d: Mapping[str, Any])[source]#

Bases: DatamementoPropertiesMixin

d: Mapping[str, Any]#
id: int#
action_type: int#

Enum: ModActionType

agent_name: str#

Name of the mod who performed the action.

Unknown what happens if the user is deleted. Is the value [deleted], an empty string, or does the field in the underlying object not exist? If you have any information about this, please open an issue report at https://github.com/Pyprohly/redditwarp/issues.

agent_id: int#

User ID of the mod who performed the action.

Unknown what happens if the user is deleted. If you have any information about this, please open an issue report at https://github.com/Pyprohly/redditwarp/issues.

datetime: datetime#

Datetime object of when the action was performed.

class redditwarp.models.modmail.UserDossier(d: Mapping[str, Any])[source]#

Bases: DatamementoPropertiesMixin

class RecentPost(id: 'int', permalink: 'str', title: 'str', created_at: 'datetime')[source]#

Bases: object

id: int#

The submission ID.

A URL to the submission.

title: str#

Title of the submission.

created_at: datetime#

When the submission was created.

class RecentComment(id: 'int', permalink: 'str', submission_title: 'str', body: 'str', created_at: 'datetime')[source]#

Bases: object

id: int#

The comment ID.

A URL to the comment.

submission_title: str#

The title of the submission in which the comment resides.

body: str#

The comment the user wrote.

created_at: datetime#

When the comment was created.

class RecentConvo(id: 'int', subject: 'str', permalink: 'str')[source]#

Bases: object

id: int#

The conversation ID.

subject: str#

The subject line of the conversation.

A URL to the conversation.

E.g., https://mod.reddit.com/mail/perma/tiebu.

d: Mapping[str, Any]#
id: int#
username: str#

The name of the target user.

created_at: datetime#

When the user account was created.

suspended: bool#

True if account is suspended.

shadow_banned: bool#

True if account is shadow banned.

approved_user: bool#

True if the user is an approved contributor on the subreddit.

muted: bool#

True if the user is currently muted on the subreddit.

mute_reason: str#

Mute reason.

Empty string if not currently muted.

mute_count: int#

Number of times the user has been muted in the subreddit.

mute_end_datetime: datetime#

Datetime object of when the mute ends.

Value is datetime.min if muted is false.

banned: bool#

True if the user is currently banned on the subreddit.

ban_reason: str#

Ban reason.

Empty string if not currently banned.

ban_permanent: bool#

True if the ban is permanent.

Value false if user is not banned.

ban_end_datetime: datetime#

Datetime object of when the ban ends.

Value is datetime.min if banned is false.

recent_posts: Sequence[RecentPost]#

A bit of information about the user’s recent submissions to the subreddit.

recent_comments: Sequence[RecentComment]#

A bit information about the user’s recent comments in the subreddit.

recent_convos: Sequence[RecentConvo]#

Other modmail conversations this user is involved in.

class redditwarp.models.modmail.ConversationAggregate(info: 'ConversationInfo', history: 'Sequence[object]', messages: 'Sequence[Message]', actions: 'Sequence[ModAction]', user_dossier: 'Optional[UserDossier]')[source]#

Bases: object

info: ConversationInfo#

Information about the conversation.

history: Sequence[object]#

Conversation entries.

Objects are either Message or ModAction instances.

messages: Sequence[Message]#

Conversation messages.

actions: Sequence[ModAction]#

Conversation mod actions.

user_dossier: UserDossier | None#

Information about the target user.