redditwarp.siteprocs.moderation.note_SYNC#
- class redditwarp.siteprocs.moderation.note_SYNC.Note(client: Client)[source]#
Bases:
object- create_user_note(sr: str, user: str, content: str, *, label: str = '', anchor_submission_id: int | None = None, anchor_comment_id: int | None = None) ModerationUserNote[source]#
Create a user note.
- Parameters:
sr (str) – Subreddit name.
user (str) – User name.
content (str) – Content of the note. Max 250 characters.
label (str) – Either:
BOT_BAN,PERMA_BAN,BAN,ABUSE_WARNING,SPAM_WARNING,SPAM_WATCH,SOLID_CONTRIBUTOR,HELPFUL_USER.anchor_submission_id (Optional[str]) –
A submission ID to link the note to.
Mutually exclusive with
anchor_comment_id.anchor_comment_id (Optional[str]) –
A comment ID to link the note to.
Mutually exclusive with
anchor_submission_id.
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
USER_DOESNT_EXIST:The specified user does not exist.
BAD_SR_NAME:The specified subreddit does not exist.
NO_TEXT:The content of the note was empty.
TOO_LONG:The content of the note was too long, over 250 characters.
INVALID_OPTION:The label specified was invalid.
NO_THING_ID:The linked submission or comment does not exist.
redditwarp.http.exceptions.StatusCodeException –
403:You are not a moderator of the target subreddit.
- delete(sr: str, user: str, uuid: str) None[source]#
Delete a moderation note.
This procedure can be used to delete either a user or action type note.
In addition to the note ID, the endpoint must be given the subreddit and user name in which the note belongs. If either information is incorrect, the endpoint will raise a 500 HTTP error.
- Parameters:
sr (str) –
user (str) –
uuid (str) – UUID of a note.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED:There is no user context.
BAD_SR_NAME:The
srparameter was empty.
SUBREDDIT_NOEXIST:The target subreddit does not exist.
USER_DOESNT_EXIST:The specified user does not exist.
The
userparameter was empty.
PARAMETER_REQUIRED:The
uuidparameter was empty.
INVALID_ID:The specified user does not exist.
redditwarp.http.exceptions.StatusCodeException –
500:The subreddit or user specified is incorrect for the given note ID.
The given note ID was invalid.
- pull_notes(sr: str, user: str, amount: int | None = None, *, label: str | None = None) ImpartedPaginatorChainingIterator[ModerationNotePaginator, ModerationNote][source]#
Get moderation notes of a user in a subreddit.
- Parameters:
sr (str) –
user (str) –
amount (Optional[int]) –
label (Optional[str]) –
Filter by note type.
Either:
ALL,NOTE,APPROVAL,REMOVAL,BAN,MUTE,INVITE,SPAM,CONTENT_CHANGE.
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED:There is no user context.
BAD_SR_NAME:The
srparameter was empty.
SUBREDDIT_NOEXIST:The target subreddit does not exist.
USER_DOESNT_EXIST:The specified user does not exist.
The
userparameter was empty.
INVALID_ID:An invalid value was specified for the
labelparameter. Values are case-sensitive.
- pull_user_notes(sr: str, user: str, amount: int | None = None) ImpartedPaginatorChainingIterator[ModerationUserNotePaginator, ModerationUserNote][source]#
Behaves similarly to
pull_notes().
- get_latest_user_note(sr: str, user: str) ModerationUserNote | None[source]#
Get the most recently written user note for some user.
- Parameters:
sr (str) –
user (str) –
- Return type:
Optional[ModerationUserNote]
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED:There is no user context.
PARAMETER_REQUIRED:The
srparameter was empty.The
userparameter was empty.
- bulk_get_latest_user_note(pairs: Iterable[tuple[str, str]]) CallChunkChainingIterator[ModerationUserNote | None][source]#
Bulk fetch the most recently written user notes for users.
The response contains a list of mod notes in the order that subreddits and users were given. If no note exists for a given pair,
Nonewill take its place in the list.- Parameters:
pairs (Iterable[tuple[str, str]]) –
- Return type:
CallChunkChainingIterator[Optional[ModerationUserNote]]
- (raises):
Same as
get_latest_user_note().