Comment
- class asyncpraw.models.Comment(reddit: asyncpraw.Reddit, id: Optional[str] = None, url: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)
A class that represents a reddit comment.
Typical Attributes
This table describes attributes that typically belong to objects of this class. Since attributes are dynamically provided (see Determine Available Attributes of an Object), there is not a guarantee that these attributes will always be present, nor is this list necessarily complete.
Attribute
Description
author
Provides an instance of
Redditor
.body
The body of the comment, as Markdown.
body_html
The body of the comment, as HTML.
created_utc
Time the comment was created, represented in Unix Time.
distinguished
Whether or not the comment is distinguished.
edited
Whether or not the comment has been edited.
id
The ID of the comment.
is_submitter
Whether or not the comment author is also the author of the submission.
link_id
The submission ID that the comment belongs to.
parent_id
The ID of the parent comment (prefixed with
t1_
). If it is a top-level comment, this returns the submission ID instead (prefixed witht3_
).permalink
A permalink for the comment. Comment objects from the inbox have a
context
attribute instead.replies
Provides an instance of
CommentForest
.saved
Whether or not the comment is saved.
score
The number of upvotes for the comment.
stickied
Whether or not the comment is stickied.
submission
Provides an instance of
Submission
. The submission that the comment belongs to.subreddit
Provides an instance of
Subreddit
. The subreddit that the comment belongs to.subreddit_id
The subreddit ID that the comment belongs to.
- __init__(reddit: asyncpraw.Reddit, id: Optional[str] = None, url: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)
Construct an instance of the Comment object.
- await award(gild_type: str = 'gid_2', is_anonymous: bool = True, message: Optional[str] = None) dict
Award the author of the item.
- Parameters
gild_type – Type of award to give. See table below for currently know global award types.
is_anonymous – If True, the authenticated user’s username will not be revealed to the recipient.
message – Message to include with the award.
- Returns
A dict containing info similar to what is shown below:
{ "subreddit_balance": 85260, "treatment_tags": [], "coins": 8760, "gildings": {"gid_1": 0, "gid_2": 1, "gid_3": 0}, "awarder_karma_received": 4, "all_awardings": [ { "giver_coin_reward": 0, "subreddit_id": None, "is_new": False, "days_of_drip_extension": 0, "coin_price": 75, "id": "award_9663243a-e77f-44cf-abc6-850ead2cd18d", "penny_donate": 0, "coin_reward": 0, "icon_url": "https://www.redditstatic.com/gold/awards/icon/SnooClappingPremium_512.png", "days_of_premium": 0, "icon_height": 512, "tiers_by_required_awardings": None, "icon_width": 512, "static_icon_width": 512, "start_date": None, "is_enabled": True, "awardings_required_to_grant_benefits": None, "description": "For an especially amazing showing.", "end_date": None, "subreddit_coin_reward": 0, "count": 1, "static_icon_height": 512, "name": "Bravo Grande!", "icon_format": "APNG", "award_sub_type": "PREMIUM", "penny_price": 0, "award_type": "global", "static_icon_url": "https://i.redd.it/award_images/t5_q0gj4/59e02tmkl4451_BravoGrande-Static.png", } ], }
Requires the authenticated user to own Reddit Coins. Calling this method will consume Reddit Coins.
To award the gold award anonymously do:
comment = await reddit.comment("dkk4qjd") await comment.award() submission = await reddit.submission("8dmv8z") await submission.award()
To award the platinum award with the message ‘Nice!’ and reveal your username to the recipient do:
comment = await reddit.comment("dkk4qjd") await comment.award(gild_type="gild_3", message="Nice!", is_anonymous=False) submission = await reddit.submission("8dmv8z") await submission.award(gild_type="gild_3", message="Nice!", is_anonymous=False)
This is a list of known global awards (as of 10/25/2020)
Name
Icon
Gild Type
Description
Cost
Silver
gid_1
Shows the Silver Award… and that’s it.
100
Gold
gid_2
Gives the author a week of Reddit Premium, %{coin_symbol}100 Coins to do with as they please, and shows a Gold Award.
500
Platinum
gid_3
Gives the author a month of Reddit Premium, which includes %{coin_symbol}700 Coins for that month, and shows a Platinum Award.
1800
LOVE!
award_5eac457f-ebac-449b-93a7-eb17b557f03c
When you follow your heart, love is the answer
20
Starstruck
award_abb865cf-620b-4219-8777-3658cf9091fb
Can’t stop seeing stars
20
All-Seeing Upvote
award_b4ff447e-05a5-42dc-9002-63568807cfe6
A glowing commendation for all to see
30
Narwhal Salute
award_a2506925-fc82-4d6c-ae3b-b7217e09d7f0
A golden splash of respect
30
Wholesome Seal of Approval
award_c4b2e438-16bb-4568-88e7-7893b7662944
A glittering stamp for a feel-good thing
30
Ally
award_69c94eb4-d6a3-48e7-9cf2-0f39fed8b87c
Listen, get educated, and get involved.
50
I am disappoint
award_03c4f93d-efc7-463b-98a7-c01814462ab0
I’m not mad, I’m just disappointed.
50
Looking Busy
award_d33fddd7-a58a-4472-b1a2-3157d8c8b76f
Looking like you’re working is hard work.
50
Take My Energy
award_02d9ab2c-162e-4c01-8438-317a016ed3d9
I’m in this with you.
50
Wearing is Caring
award_80d4d339-95d0-43ac-b051-bc3fe0a9bab8
Keep the community and yourself healthy and happy.
50
Facepalm
award_b1b44fa1-8179-4d84-a9ed-f25bb81f1c5f
Lowers face into palm
70
Faith In Humanity Restored
award_7becef23-fb0b-4d62-b8a6-01d5759367cb
When goodness lifts you
70
Snek
award_99d95969-6100-45b2-b00c-0ec45ae19596
A smol, delicate danger noodle.
70
Tree Hug
award_b92370bb-b7de-4fb3-9608-c5b4a22f714a
Show nature some love.
70
Bravo Grande!
award_9663243a-e77f-44cf-abc6-850ead2cd18d
For an especially amazing showing.
75
Party Train
award_75f9bc56-eba3-4988-a1af-aec974404a0b
All aboard! Every 5 Awards from everyone gives the author 100 Coins and 1 week of Premium. Rack up the number of Awards and watch the Train level-up.
75
Take My Power
award_92cb6518-a71a-4217-9f8f-7ecbd7ab12ba
Add my power to yours.
75
Hugz
award_8352bdff-3e03-4189-8a08-82501dd8f835
Everything is better with a good hug
80
‘MURICA
award_869d4135-8738-41e5-8630-de593b4f049f
Did somebody say ‘Murica?
100
Cosplay Famous
award_6f0a496f-c3e2-484c-90d0-d26bffb2e286
The perfect cosplay doesn’t exis…
100
Dread
award_81cf5c92-8500-498c-9c94-3e4034cece0a
Staring into the abyss and it’s staring right back
100
Evil Cackle
award_483d8e29-bbe5-404e-a09a-c2d7b16c4fff
Laugh like a supervillain
100
Excited
award_74fe5152-7906-4991-9016-bc2d8e261200
I don’t know what to do with my hands!
100
Glow Up
award_01178870-6a4f-4172-8f36-9ed5092ee4f9
You look amazing, glowing, incredible!
100
Heartwarming
award_19860e30-3331-4bac-b3d1-bd28de0c7974
I needed this today
100
I’ll Drink to That
award_3267ca1c-127a-49e9-9a3d-4ba96224af18
Let’s sip to good health and good company
100
Keep Calm
award_1da6ff27-7c0d-4524-9954-86e5cda5fcac
Stop, chill, relax
100
Kiss
award_1e516e18-cbee-4668-b338-32d5530f91fe
You deserve a smooch
100
Last Minute Costume
award_a0c3e268-87e7-4918-9a36-f6aa462e4dee
Any costume beats none
100
Lawyer Up
award_ae89e420-c4a5-47b8-a007-5dacf1c0f0d4
OBJECTION!
100
Masterpiece
award_b4072731-c0fb-4440-adc7-1063d6a5e6a0
C’est magnifique
100
Shocked
award_fbe9527a-adb3-430e-af1a-5fd3489e641b
I’m genuinely flabbergasted.
100
Spacefaring Snoo
award_a3df1615-dcf8-4f5f-ac7c-3c2be31332a7
On a vision quest to make life multi-planetary
100
Sweet Tooth
award_bd6ccb1d-118a-462a-a451-f550cd3133d2
It’s not a sugar rush, it’s a lifestyle.
100
Tearing Up
award_43f3bf99-92d6-47ab-8205-130d26e7929f
This hits me right in the feels
100
Yummy
award_ae7f17fb-6538-4c75-9ff4-5f48b4cdaa94
That looks so good
100
Wholesome
award_5f123e3d-4f48-42f4-9c11-e98b566d5897
When you come across a feel-good thing.
125
Bless Up
award_77ba55a2-c33c-4351-ac49-807455a80148
Prayers up for the blessed.
150
Buff Doge
award_c42dc561-0b41-40b6-a23d-ef7e110e739e
So buff, wow
150
Cake
award_5fb42699-4911-42a2-884c-6fc8bdc36059
Did someone say… cake?
150
Helpful
award_f44611f1-b89e-46dc-97fe-892280b13b82
Thank you stranger. Shows the award.
150
Press F
award_88fdcafc-57a0-48db-99cc-76276bfaf28b
To pay respects.
150
Take My Money
award_a7f9cbd7-c0f1-4569-a913-ebf8d18de00b
I’m buying what you’re selling
150
Giggle
award_e813313c-1002-49bf-ac37-e966710f605f
Innocent laughter
200
Got the W
award_8dc476c7-1478-4d41-b940-f139e58f7756
200
I’d Like to Thank…
award_1703f934-cf44-40cc-a96d-3729d0b48262
My kindergarten teacher, my cat, my mom, and you.
200
I’m Deceased
award_b28d9565-4137-433d-bb65-5d4aa82ade4c
Call an ambulance, I’m laughing too hard.
200
Looking
award_4922c1be-3646-4d62-96ea-19a56798df51
I can’t help but look.
200
Plus One
award_f7562045-905d-413e-9ed2-0a16d4bfe349
You officially endorse and add your voice to the crowd.
200
Stonks Falling
award_9ee30a8f-463e-4ef7-9da9-a09f270ec026
Losing value fast.
200
Stonks Rising
award_d125d124-5c03-490d-af3d-d07c462003da
To the MOON.
200
This is 2020
award_dc391ef9-0df8-468f-bd3c-7b177092de35
Every reason to be alarmed
200
1UP
award_11be92ba-509e-46d3-991b-593239006521
Extra life
250
Awesome Answer
award_2adc49e8-d6c9-4923-9293-2bfab1648569
For a winning take and the kind soul who nails a question. Gives %{coin_symbol}100 Coins to both the author and the community.
250
It’s Cute!
award_cc540de7-dfdb-4a68-9acf-6f9ce6b17d21
You made me UwU.
250
Mind Blown
award_9583d210-a7d0-4f3c-b0c7-369ad579d3d4
When a thing immediately combusts your brain. Gives %{coin_symbol}100 Coins to both the author and the community.
250
Original
award_d306c865-0d49-4a36-a1ab-a4122a0e3480
When something new and creative wows you. Gives %{coin_symbol}100 Coins to both the author and the community.
250
Timeless Beauty
award_31260000-2f4a-4b40-ad20-f5aa46a577bf
Beauty that’s forever. Gives %{coin_symbol}100 Coins each to the author and the community.
250
Today I Learned
award_a67d649d-5aa5-407e-a98b-32fd9e3a9696
The more you know… Gives %{coin_symbol}100 Coins to both the author and the community.
250
Yas Queen
award_d48aad4b-286f-4a3a-bb41-ec05b3cd87cc
YAAAAAAAAAAASSS.
250
Coin Gift
award_3dd248bc-3438-4c5b-98d4-24421fd6d670
Give the gift of %{coin_symbol}250 Reddit Coins.
300
Crab Rave
award_f7a4fd5e-7cd1-4c11-a1c9-c18d05902e81
[Happy crab noises]
300
Frankensnoo
award_aef30fbe-92e4-4593-8aa7-4b82cfe8d172
It’s Alive!!! Spread the Spooktober spirit.
300
GOAT
award_cc299d65-77de-4828-89de-708b088349a0
Historical anomaly - greatest in eternity.
300
Rocket Like
award_28e8196b-d4e9-45bc-b612-cd4c7d3ed4b3
When an upvote just isn’t enough, smash the Rocket Like.
300
Spooky Season
award_176a3f8a-2229-4a12-bcdc-86464cfd6dc1
Too spooky for me. Spread the Spooktober spirit.
300
Table Flip
award_3e000ecb-c1a4-49dc-af14-c8ac2029ca97
ARGH!
300
This
award_68ba1ee3-9baf-4252-be52-b808c1e8bdc4
THIS right here! Join together to give multiple This awards and see the award evolve in its display and shower benefits for the recipient. For every 3 This awards given to a post or comment, the author will get 250 coins.
300
Updoot
award_725b427d-320b-4d02-8fb0-8bb7aa7b78aa
Sometimes you just got to doot.
300
Spit-take
award_3409a4c0-ba69-43a0-be9f-27bc27c159cc
Shower them with laughs
325
Super Heart Eyes
award_6220ecfe-4552-4949-aa13-fb1fb7db537c
When the love is out of control.
325
Table Slap
award_9f928aff-c9f5-4e7e-aa91-8619dce60f1c
When laughter meets percussion
325
To The Stars
award_2bc47247-b107-44a8-a78c-613da21869ff
Boldly go where we haven’t been in a long, long time.
325
Aww-some
award_e55d1889-11f2-4d04-8abb-44b1de7dd53d
Use the Aww-some Award to highlight comments that are absolutely adorable.
350
Heartbeat
award_11eb6af3-3d0d-4d70-8261-22d216ab591d
Use the Heartbeat Award to highlight comments that make you feel warm and fuzzy
350
Into the Magic Portal
award_2ff1fdd0-ff73-47e6-a43c-bde6d4de8fbd
Hope to make it to the other side.
350
Out of the Magic Portal
award_7fe72f36-1141-4a39-ba76-0d481889b390
That was fun, but I’m glad to be back
350
Bravo!
award_84276b1e-cc8f-484f-a19c-be6c09adc1a5
An amazing showing.
400
Doot 🎵 Doot
award_5b39e8fd-7a58-4cbe-8ca0-bdedd5ed1f5a
Sometimes you just got to dance with the doots.
400
Pumpkin Spice
award_89164d08-80db-453b-a7aa-74c50fa84bfa
Autumn the beverage brings a bounty of 300 coins to the lucky recipient.
400
Bless Up (Pro)
award_43c43a35-15c5-4f73-91ef-fe538426435a
Prayers up for the blessed. Gives %{coin_symbol}100 Coins to both the author and the community.
500
Brighten My Day
award_9591a26e-b2e4-4ef2-bed4-28ff69246691
The clouds part and the sun shines through. Use the Brighten My Day Award to highlight comments that are a ray of sunshine.
500
Eureka!
award_65f78ca2-45d8-4cb6-bf79-a67beadf2e47
Now that is a bright idea. Use the Eureka Award to highlight comments that are brilliant.
500
Heart Eyes
award_a9009ea5-1a36-42ae-aab2-5967563ee054
For love at first sight. Gives %{coin_symbol}100 Coins to both the author and the community.
500
Helpful (Pro)
award_2ae56630-cfe0-424e-b810-4945b9145358
Thank you stranger. Gives %{coin_symbol}100 Coins to both the author and the community.
500
Made Me Smile
award_a7a04d6a-8dd8-41bb-b906-04fa8f144014
When you’re smiling before you know it. Gives %{coin_symbol}100 Coins to both the author and the community.
500
Snoo Nice
award_27d3176c-b388-4616-80ec-11b8ece5b7ee
Gives the author a week of Reddit Premium and %{coin_symbol}100 Coins to do with as they please.
500
Starry
award_0e957fb0-c8f1-4ba1-a8ef-e1e524b60d7d
Use the Starry Award to highlight comments that deserve to stand out from the crowd.
500
Wholesome (Pro)
award_1f0462ee-18f5-4f33-89cf-f1f79336a452
When you come across a feel-good thing. Gives %{coin_symbol}100 Coins to both the author and the community.
500
Pot o’ Coins
award_35c78e6e-507b-4f1d-b3d8-ed43840909a8
The treasure at the end of the rainbow. Gives the author 800 Coins to do with as they please.
1000
Cornucopia
award_9a123cdb-d26d-4d0c-b7fa-46750b8289fa
A candy cornucopia of love that gives the author a bounty of 1500 Coins.
2000
Argentium
award_4ca5a4e6-8873-4ac5-99b9-71b1d5161a91
Latin for distinguished. Shimmers like silver & stronger than steel. When someone deserves outsize recognition. This award gives a three-month Premium subscription and 2500 coins to the recipient.
20000
Ternion All-Powerful
award_2385c499-a1fb-44ec-b9b7-d260f3dc55de
Legendary level. A no holds barred celebration of something that hits you in the heart, mind and soul. Some might call it unachievanium. Gives the author 6 months of Premium and 5000 Coins.
50000
- await block()
Block the user who sent the item.
Note
This method pertains only to objects which were retrieved via the inbox.
Example usage:
comment = await reddit.comment("dkk4qjd") await comment.block() # or, identically: comment = await reddit.comment("dkk4qjd") await comment.author.block()
- await clear_vote()
Clear the authenticated user’s vote on the object.
Note
Votes must be cast by humans. That is, API clients proxying a human’s action one-for-one are OK, but bots deciding how to vote on content or amplifying a human’s vote are not. See the reddit rules for more details on what constitutes vote cheating. [Ref]
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.clear_vote() comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.clear_vote()
- await collapse()
Mark the item as collapsed.
Note
This method pertains only to objects which were retrieved via the inbox.
Example usage:
inbox = reddit.inbox() # select first inbox item and collapse it async for message in inbox: await message.collapse() break
See also
- await delete()
Delete the object.
Example usage:
comment = await reddit.comment("dkk4qjd", fetch=False) await comment.delete() submission = await reddit.submission("8dmv8z", fetch=False) await submission.delete()
- await disable_inbox_replies()
Disable inbox replies for the item.
Example usage:
comment = await reddit.comment("dkk4qjd", fetch=False) await comment.disable_inbox_replies() submission = await reddit.submission("8dmv8z", fetch=False) await submission.disable_inbox_replies()
See also
- await downvote()
Downvote the object.
Note
Votes must be cast by humans. That is, API clients proxying a human’s action one-for-one are OK, but bots deciding how to vote on content or amplifying a human’s vote are not. See the reddit rules for more details on what constitutes vote cheating. [Ref]
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.downvote() comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.downvote()
See also
- await edit(body)
Replace the body of the object with
body
.- Parameters
body – The Markdown formatted content for the updated object.
- Returns
The current instance after updating its attributes.
Example usage:
comment = await reddit.comment("dkk4qjd") # construct the text of an edited comment # by appending to the old body: edited_body = comment.body + "Edit: thanks for the gold!" await comment.edit(edited_body)
- await enable_inbox_replies()
Enable inbox replies for the item.
Example usage:
comment = await reddit.comment("dkk4qjd", fetch=False) await comment.enable_inbox_replies() submission = await reddit.submission("8dmv8z", fetch=False) await submission.enable_inbox_replies()
See also
- property fullname: str
Return the object’s fullname.
A fullname is an object’s kind mapping like
t3
followed by an underscore and the object’s base36 ID, e.g.,t1_c5s96e0
.
- property is_root: bool
Return True when the comment is a top level comment.
- Raises
AttributeError
if the comment is not fetched.
- await load()
Re-fetches the object.
This is used to explicitly fetch or re-fetch the object from reddit. This method can be used on any
RedditBase
object.await reddit_base_object.load()
- await mark_read()
Mark a single inbox item as read.
Note
This method pertains only to objects which were retrieved via the inbox.
Example usage:
inbox = reddit.inbox.unread() async for message in inbox: # process unread messages ...
See also
To mark the whole inbox as read with a single network request, use
asyncpraw.models.Inbox.mark_all_read()
- await mark_unread()
Mark the item as unread.
Note
This method pertains only to objects which were retrieved via the inbox.
Example usage:
inbox = reddit.inbox(limit=10) async for message in inbox: # process messages ...
See also
- mod() asyncpraw.models.reddit.comment.CommentModeration
Provide an instance of
CommentModeration
.Example usage:
comment = await reddit.comment("dkk4qjd", fetch=False) await comment.mod.approve()
- await parent() Union[Comment, asyncpraw.models.Submission]
Return the parent of the comment.
The returned parent will be an instance of either
Comment
, orSubmission
.If this comment was obtained through a
Submission
, then its entire ancestry should be immediately available, requiring no extra network requests. However, if this comment was obtained through other means, e.g.,await reddit.comment("COMMENT_ID")
, orreddit.inbox.comment_replies
, then the returned parent may be an instance of eitherComment
, orSubmission
.Lazy comment example:
comment = await reddit.comment("cklhv0f", fetch=False) parent = await comment.parent() # `replies` is empty until the comment is refreshed print(parent.replies) # Output: [] await parent.refresh() print(parent.replies) # Output is at least: [Comment(id="cklhv0f")]
Warning
Successive calls to
parent()
may result in a network request per call when the comment is not obtained through aSubmission
. See below for an example of how to minimize requests.If you have a deeply nested comment and wish to most efficiently discover its top-most
Comment
ancestor you can chain successive calls toparent()
with calls torefresh()
at every 9 levels. For example:ancestor = await reddit.comment("dkk4qjd") refresh_counter = 0 while not ancestor.is_root: ancestor = await ancestor.parent() if refresh_counter % 9 == 0: await ancestor.refresh() refresh_counter += 1 print(f"Top-most Ancestor: {ancestor}")
The above code should result in 5 network requests to Reddit. Without the calls to
refresh()
it would make at least 31 network requests.
- classmethod parse(data: Dict[str, Any], reddit: asyncpraw.Reddit) Any
Return an instance of
cls
fromdata
.- Parameters
data – The structured data.
reddit – An instance of
Reddit
.
- await refresh()
Refresh the comment’s attributes.
If using
Reddit.comment()
withfetch=False
, this method must be called in order to obtain the comment’s replies.Example usage:
comment = await reddit.comment("dkk4qjd", fetch=False) await comment.refresh()
- property replies: asyncpraw.models.comment_forest.CommentForest
Provide an instance of
CommentForest
.This property may return an empty list if the comment has not been refreshed with
refresh()
Sort order and reply limit can be set with the
reply_sort
andreply_limit
attributes before replies are fetched, including any call torefresh()
:comment.reply_sort = "new" await comment.refresh() replies = comment.replies
Note
The appropriate values for
reply_sort
includeconfidence
,controversial
,new
,old
,q&a
, andtop
.
- await reply(body: str)
Reply to the object.
- Parameters
body – The Markdown formatted content for a comment.
- Returns
A
Comment
object for the newly created comment orNone
if Reddit doesn’t provide one.
A
None
value can be returned if the target is a comment or submission in a quarantined subreddit and the authenticated user has not opt-ed in to viewing the content. When this happens the comment will be successfully created on Reddit and can be retried by drawing the comment from the user’s comment history.Note
Some items, such as locked submissions/comments or non-replyable messages will throw
asyncprawcore.exceptions.Forbidden
when attempting to reply to them.Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.reply("reply") comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.reply("reply")
- await report(reason: str)
Report this object to the moderators of its subreddit.
- Parameters
reason – The reason for reporting.
- Raises
RedditAPIException
ifreason
is longer than 100 characters.
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.report("report reason") comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.report("report reason")
- await save(category: Optional[str] = None)
Save the object.
- Parameters
category – (Premium) The category to save to. If your user does not have Reddit Premium this value is ignored by Reddit (default:
None
).
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.save(category="view later") comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.save()
See also
- property submission: asyncpraw.models.Submission
Return the Submission object this comment belongs to.
- Raises
AttributeError
if the comment is not fetched.
- await unblock_subreddit()
Unblock a subreddit.
Note
This method pertains only to objects which were retrieved via the inbox.
For example, to unblock all blocked subreddits that you can find by going through your inbox:
from asyncpraw.models import SubredditMessage subs = set() async for item in reddit.inbox.messages(limit=None): if isinstance(item, SubredditMessage): if ( item.subject == "[message from blocked subreddit]" and str(item.subreddit) not in subs ): item.unblock_subreddit() subs.add(str(item.subreddit))
- await uncollapse()
Mark the item as uncollapsed.
Note
This method pertains only to objects which were retrieved via the inbox.
Example usage:
inbox = reddit.inbox() # select first inbox item and uncollapse it async for message in inbox: await message.uncollapse() break
See also
- await unsave()
Unsave the object.
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.unsave() comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.unsave()
See also
- await upvote()
Upvote the object.
Note
Votes must be cast by humans. That is, API clients proxying a human’s action one-for-one are OK, but bots deciding how to vote on content or amplifying a human’s vote are not. See the reddit rules for more details on what constitutes vote cheating. [Ref]
Example usage:
submission = await reddit.submission(id="5or86n", fetch=False) await submission.upvote() comment = await reddit.comment(id="dxolpyc", fetch=False) await comment.upvote()
See also
Note
This list of attributes is not complete. Async PRAW dynamically provides the attributes that Reddit returns via the API. Because those attributes are subject to change on Reddit’s end, Async PRAW makes no effort to document them, other than to instruct you on how to discover what is available. See Determine Available Attributes of an Object for detailed information.