Redditor¶
This section describes the usage and members of the Redditor model.
A Redditor can be instantiated as follows:
sub = await reddit.redditor("aprawbot")
- class apraw.models.Redditor(reddit: Reddit, data: Dict)¶
The model representing Redditors.
- reddit: Reddit
The
Reddit
instance with which requests are made.- data: Dict
The data obtained from the /about endpoint.
- kind: str
The item’s kind / type.
- subreddit: Sureddit
An instance of
Subreddit
for the Redditor’s profile subreddit.
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
comment_karma
The amount of comment karma the Redditor has obtained.
created_utc
The date on which the Redditor was created in UTC
datetime
.created
The timestamp of when the Redditor was created.
has_verified_email
Whether the Redditor has a verified email address.
icon_img
A URL to the Redditor’s icon image if applicable.
id
The Redditor’s ID (without kind).
is_employee
Whether the Redditor is a Reddit employee.
is_friend
Whether the Redditor has been added as a friend.
is_gold
Whether the Redditor is a Reddit gold member.
is_mod
Whether the Redditor is a moderator in a subreddit.
is_suspended
Whether the Redditor has been suspended.
link_karma
The amount of link karma the Redditor has obtained.
name
The Redditor’s username.
pref_show_snoovatar
Whether to show the Redditor’s Snoovatar in place of their icon.
verified
Whether the Redditor is verified.
Warning
Suspended Redditors only return
is_suspended
andname
.- comments(*args, **kwargs)¶
Returns an instance of
ListingGenerator
mapped to fetch the Redditor’s comments.Note
This listing can be streamed doing the following:
for comment in redditor.comments.stream(): print(comment)
- Parameters
kwargs (**Dict) –
ListingGenerator
kwargs
.- Returns
generator – A
ListingGenerator
mapped to fetch the Redditor’s comments.- Return type
- async fetch()¶
Fetch this item’s information from a suitable API endpoint.
- Returns
self – The updated
Redditor
.- Return type
- async message(subject, text, from_sr='') Dict ¶
Message the Redditor.
- Parameters
subject (str) – The subject of the message.
text (str) – The text contents of the message in markdown.
from_sr (str) – The subreddit the message is being sent from if applicable.
- Returns
resp – The response data returned from the endpoint.
- Return type
Dict
- moderated_subreddits(**kwargs) Subreddit ¶
Yields the subreddits the Redditor moderates.
- Parameters
kwargs (**Dict) –
kwargs
to be used as query parameters.- Yields
subreddit (Subreddit) – A subreddit the user moderates.
- submissions(*args, **kwargs)¶
Returns an instance of
ListingGenerator
mapped to fetch the Redditor’s submissions.Note
This listing can be streamed doing the following:
for comment in redditor.submissions.stream(): print(comment)
- Parameters
kwargs (**Dict) –
ListingGenerator
kwargs
.- Returns
generator – A
ListingGenerator
mapped to fetch the Redditor’s submissions.- Return type