redditwarp.siteprocs.user.ASYNC#

class redditwarp.siteprocs.user.ASYNC.UserProcedures(client: Client)[source]#

Bases: object

pull: Pull#

Pull submissions and comments associated with a user.

pull_subreddits: PullSubreddits#

Get user subreddits.

async get_by_name(name: str) User | None[source]#

Get information about a user by name.

Returns None if the specified user was not found, or is a suspended account.

Parameters:

name (str) – User name.

Return type:

Optional[User]

async fetch_by_name(name: str) User[source]#

Fetch information about a user by name.

Parameters:

name (str) – User name.

Return type:

User

Raises:
async get_potentially_suspended_by_name(name: str) object | None[source]#

Get information about a potentially suspended user, by name.

Returns None if the specified user was not found.

Parameters:

name (str) –

Returns:

  • User if the user exists.

  • SuspendedUser if the user is suspended.

  • None if the user was not found.

Return type:

Optional[object]

async fetch_potentially_suspended_by_name(name: str) object[source]#

Fetch information about a potentially suspended user, by name.

Parameters:

name (str) –

Returns:

Return type:

object

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 404:

    The specified user was not found.

async get_user_summary(idy: int | str) UserSummary | None[source]#

Get a partial user object by ID.

Parameters:

idn (Union[int, str]) –

Returns:

Return type:

Optional[UserSummary]

bulk_fetch_user_summary(ids: Iterable[_YIntOrStr]) CallChunkChainingAsyncIterator[UserSummary][source]#

Bulk fetch partial user objects, by ID.

Any ID that can’t be resolved will be ignored. Duplicate IDs in a batch will be ignored.

Parameters:

ids (Iterable[_YIntOrStr]) –

Return type:

CallChunkChainingAsyncIterator[UserSummary]

async moderating(name: str) Sequence[ModeratedSubreddit][source]#

Get a list of partial subreddit objects the target user is a moderator of.

This endpoint isn’t very reliable on users with big lists.

The specified user’s own user subreddit won’t be returned, but any other user subreddit they moderate will be.

See also

p.account.pull_subreddits.moderating()

For obtaining a list of the current user’s moderated subreddits.

Parameters:

name (str) –

Return type:

Sequence[ModeratedSubreddit]

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 404:

    The specified user was not found.

search(query: str, amount: int | None = None) ImpartedPaginatorChainingAsyncIterator[UserSearchAsyncPaginator, User][source]#

Search users by name or description.

Parameters:
  • query (str) –

  • amount (Optional[int]) –

Return type:

ImpartedPaginatorChainingAsyncIterator[UserSearchAsyncPaginator, User]

async exists(name: str) bool[source]#

Check whether a user name exists.

Parameters:

name (str) –

Return type:

bool

Raises:

redditwarp.exceptions.RedditError

  • BAD_USERNAME:
    • The specified parameter is empty.

    • The specified username contains illegal characters.