redditwarp.siteprocs.modmail.conversation_SYNC
#
- class redditwarp.siteprocs.modmail.conversation_SYNC.ConversationProcedures(client: Client)[source]#
Bases:
object
- fetch(idy: int | str, *, mark_read: bool = False) ConversationAggregate [source]#
Get a conversation.
- Parameters:
idy (Union[int, str]) – Conversation ID.
mark_read (bool) –
Mark retrieved conversations as read.
Default: false.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
SUBREDDIT_NO_ACCESS
:The subreddit associated with the conversation is not moderated by you.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
- create_to_user(sr: str, to: str, subject: str, body: str, *, hidden: bool = False) ConversationAggregate [source]#
Create a to-user conversation.
- Parameters:
sr (str) – The name of the subreddit in which to create the conversation for.
to (str) –
The modmail recipient name.
If the specified user is a moderator of the subreddit, this parameter is ignored and an internal moderator conversation is created instead.
subject (str) – A subject line for the conversation.
body (str) – Markdown text.
hidden (bool) –
Expose your user name to the recipient.
Default: false.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
BAD_SR_NAME
:The specified source subreddit was empty.
SUBREDDIT_NOEXIST
:The specified source subreddit does not exist.
NO_TEXT
:The
subject
was empty.The
body
was empty.
TOO_LONG
:The value specified for
subject
must be 100 characters or fewer (despite error message saying under 100).The value specified for
body
must be 10000 characters or fewer (despite error message saying under 10000).
- create_to_subreddit(sr: str, to: str, subject: str, body: str) ConversationAggregate [source]#
Create a to-subreddit conversation.
- Parameters:
sr (str) – The name of the subreddit in which to create the conversation for.
to (str) –
The target subreddit name.
Specify an empty string to create an internal moderator conversation.
subject (str) – A subject line for the conversation.
body (str) – Markdown text.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
BAD_SR_NAME
:The specified source subreddit was empty.
SUBREDDIT_NOEXIST
:The specified source or target subreddit does not exist.
NO_TEXT
:The
subject
was empty.The
body
was empty.
TOO_LONG
:The value specified for
subject
must be 100 characters or fewer (despite error message saying under 100).The value specified for
body
must be 10000 characters or fewer (despite error message saying under 10000).
- reply(idy: int | str, body: str, *, hidden: bool = False, internal: bool = False) ConversationAggregate [source]#
Create a new message on an existing conversation.
- Parameters:
idy (Union[int, str]) – Conversation ID.
body (str) – Markdown text.
hidden (bool) –
Expose your user name to the recipient.
Default: false.
internal (bool) –
Create a private moderator note.
Default: false.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
SUBREDDIT_NO_ACCESS
:The subreddit associated with the conversation is not moderated by you.
NO_TEXT
:The
body
was empty.
TOO_LONG
:The value specified for
body
must be 10000 characters or fewer (despite error message saying under 10000).
- mark_read(idy: int | str) None [source]#
Mark a conversation as read.
- Parameters:
idy (Union[int, str]) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
UNKNOWN_ERROR
:The string ID contained invalid characters.
- bulk_mark_read(ids: Iterable[_YIntOrStr]) CallChunkCallingIterator[None] [source]#
Mark conversations as read.
Any specified conversation that does not exist will be ignored. If any of the IDs refer to a conversation you do not have permission over, an
INVALID_CONVERSATION_ID
API error will occur and none of the conversations will be processed.- Parameters:
ids (Iterable[_YIntOrStr]) –
- Return type:
CallChunkCallingIterator
[None
]
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
INVALID_CONVERSATION_ID
:You do not have permission to mark as read one of the specified conversations. The operation is aborted and none of the items will be processed.
UNKNOWN_ERROR
:The string ID contained invalid characters. The operation is aborted and none of the items will be processed.
- mark_unread(idy: int | str) None [source]#
Mark a conversation as unread.
Behaves similarly to
mark_read()
.
- bulk_mark_unread(ids: Iterable[_YIntOrStr]) CallChunkCallingIterator[None] [source]#
Mark conversations as unread.
Behaves similarly to
bulk_mark_read()
.
- class BulkMarkAllRead(outer: ConversationProcedures)[source]#
Bases:
object
- y_int(mailbox: str, subrs: Iterable[str]) CallChunkChainingIterator[int] [source]#
- y_str(mailbox: str, subrs: Iterable[str]) CallChunkChainingIterator[str] [source]#
- property bulk_mark_all_read: None#
Mark all conversations across select mailboxes and subreddits as read.
Specified subreddit names that do not exist will be ignored, but if none of the subreddits exist then a 500 HTTP error will occur. If any of the subreddits are not moderated by you then a
BAD_SR_NAME
API error will occur, and none of the conversations will be processed.- Parameters:
mailbox (str) –
Either:
all
,appeals
,notifications
,inbox
,filtered
,inprogress
,mod
,archived
,default
,highlighted
,join_requests
,new
.Defaults to
all
if empty string.subrs (Iterable[str]) – Subreddit names.
- Return type:
- Returns:
- For
_YIntOrStr
=int
: - For
_YIntOrStr
=str
:
- For
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
INVALID_OPTION
The specified
mailbox
was invalid.
BAD_SR_NAME
:One of the specified subreddits is not a subreddit you have access to.
- highlight(idy: int | str) ConversationAggregate [source]#
Mark a conversation as highlighted.
- Params Union[int, str] idy
Union[int, str]
idy:
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
SUBREDDIT_NO_ACCESS
:The subreddit associated with the conversation is not moderated by you.
- Params Union[int, str] idy
- unhighlight(idy: int | str) ConversationAggregate [source]#
Unmark a conversation as highlighted.
Behaves similarly to
highlight()
.
- archive(idy: int | str) ConversationAggregate [source]#
Archive a conversation.
Hint
Archiving a conversation moves it to the
archived
mailbox folder.- Params Union[int, str] idy
Union[int, str]
idy:
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
INVALID_MOD_PERMISSIONS
:The subreddit associated with the conversation is not moderated by you.
- Params Union[int, str] idy
- unarchive(idy: int | str) ConversationAggregate [source]#
Unmark a conversation as highlighted.
Behaves similarly to
highlight()
.
- approve_user(idy: int | str) ConversationAggregate [source]#
Approve the user associated with a conversation.
- Params Union[int, str] idy
Union[int, str]
idy:
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
INVALID_MOD_PERMISSIONS
:The subreddit associated with the conversation is not moderated by you.
CANT_RESTRICT_MODERATOR
:There is no user associated with the conversation.
- Params Union[int, str] idy
- unapprove_user(idy: int | str) ConversationAggregate [source]#
Unapprove the user associated with a conversation.
Behaves similarly to
approve_user()
.
- mute_user_3d(idy: int | str) ConversationAggregate [source]#
Mute the user associated with a conversation for 3 days.
- Params Union[int, str] idy
Union[int, str]
idy:
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
INVALID_MOD_PERMISSIONS
:The subreddit associated with the conversation is not moderated by you.
CANT_RESTRICT_MODERATOR
:There is no user associated with the conversation.
- Params Union[int, str] idy
- mute_user_7d(idy: int | str) ConversationAggregate [source]#
Mute the user associated with a conversation for 7 days.
Behaves similarly to
mute_user_3d()
.
- mute_user_28d(idy: int | str) ConversationAggregate [source]#
Mute the user associated with a conversation for 28 days.
Behaves similarly to
mute_user_3d()
.
- unmute_user(idy: int | str) ConversationAggregate [source]#
Unmute the user associated with a conversation.
Behaves similarly to
mute_user_3d()
.
- shorten_user_ban(idy: int | str, duration: int) ConversationAggregate [source]#
Switch a permanent ban to a temporary one of the user associated with a conversation.
If the user is not permanently banned, an API error will be raised.
- Parameters:
idy (Union[int, str]) –
duration (int) –
The number of days the temporary ban should last.
Specify an integer from 1 to 999.
The UI has the options: 1, 3, 7, or 28 days.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
INVALID_MOD_PERMISSIONS
:The subreddit associated with the conversation is not moderated by you.
CANT_RESTRICT_MODERATOR
:There is no user associated with the conversation.
Participant must be banned.
:The user associated with the conversation is not banned from the subreddit.
Participant must be banned permanently.
:The user associated with the conversation is not permanently banned from the subreddit.
BAD_NUMBER
:The number specified by the
duration
parameter was not in range.
- unban_user(idy: int | str) ConversationAggregate [source]#
Unban the user associated with a conversation from the subreddit.
- Parameters:
idy (Union[int, str]) –
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
CONVERSATION_NOT_FOUND
:The specified conversation does not exist.
INVALID_MOD_PERMISSIONS
:The subreddit associated with the conversation is not moderated by you.
CANT_RESTRICT_MODERATOR
:There is no user associated with the conversation.