Submission¶
- class asyncpraw.models.Submission(reddit: asyncpraw.Reddit, id: Optional[str] = None, url: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)¶
A class for submissions to reddit.
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
.clicked
Whether or not the submission has been clicked by the client.
comments
Provides an instance of
CommentForest
.created_utc
Time the submission was created, represented in Unix Time.
distinguished
Whether or not the submission is distinguished.
edited
Whether or not the submission has been edited.
id
ID of the submission.
is_original_content
Whether or not the submission has been set as original content.
is_self
Whether or not the submission is a selfpost (text-only).
link_flair_template_id
The link flair’s ID.
link_flair_text
The link flair’s text content, or None if not flaired.
locked
Whether or not the submission has been locked.
name
Fullname of the submission.
num_comments
The number of comments on the submission.
over_18
Whether or not the submission has been marked as NSFW.
permalink
A permalink for the submission.
poll_data
A
PollData
object representing the data of this submission, if it is a poll submission.saved
Whether or not the submission is saved.
score
The number of upvotes for the submission.
selftext
The submissions’ selftext - an empty string if a link post.
spoiler
Whether or not the submission has been marked as a spoiler.
stickied
Whether or not the submission is stickied.
subreddit
Provides an instance of
Subreddit
.title
The title of the submission.
upvote_ratio
The percentage of upvotes from all votes on the submission.
url
The URL the submission links to, or the permalink if a selfpost.
- __init__(reddit: asyncpraw.Reddit, id: Optional[str] = None, url: Optional[str] = None, _data: Optional[Dict[str, Any]] = None)¶
Initialize a Submission instance.
- Parameters
reddit – An instance of
Reddit
.id – A reddit base36 submission ID, e.g.,
2gmzqe
.url – A URL supported by
id_from_url()
.
Either
id
orurl
can be provided, but not both.
- 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 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", lazy=True) await submission.clear_vote() comment = await reddit.comment(id="dxolpyc", lazy=True) await comment.clear_vote()
- await comments() asyncpraw.models.comment_forest.CommentForest ¶
Provide an instance of
CommentForest
.This attribute can be used, for example, to obtain a flat list of comments, with any
MoreComments
removed:comments = await submission.comments() await comments.replace_more(limit=0) comment_list = await comments.list() for comment in comment_list: # do stuff with comment ...
Sort order and comment limit can be set with the
comment_sort
andcomment_limit
attributes before comments are fetched, including any call toreplace_more()
:submission.comment_sort = "new" comments = await submission.comments() comment_list = await comments.list() for comment in comment_list: # do stuff with comment ...
Note
The appropriate values for
comment_sort
includeconfidence
,controversial
,new
,old
,q&a
, andtop
See Extracting comments with Async PRAW for more on working with a
CommentForest
.
- await crosspost(subreddit: asyncpraw.models.Subreddit, title: Optional[str] = None, send_replies: bool = True, flair_id: Optional[str] = None, flair_text: Optional[str] = None, nsfw: bool = False, spoiler: bool = False) asyncpraw.models.Submission ¶
Crosspost the submission to a subreddit.
Note
Be aware you have to be subscribed to the target subreddit.
- Parameters
subreddit – Name of the subreddit or
Subreddit
object to crosspost into.title – Title of the submission. Will use this submission’s title if None (default: None).
flair_id – The flair template to select (default: None).
flair_text – If the template’s
flair_text_editable
value is True, this value will set a custom text (default: None).send_replies – When True, messages will be sent to the submission author when comments are made to the submission (default: True).
nsfw – Whether or not the submission should be marked NSFW (default: False).
spoiler – Whether or not the submission should be marked as a spoiler (default: False).
- Returns
A
Submission
object for the newly created submission.
Example usage:
submission = await reddit.submission(id="5or86n") cross_post = await submission.crosspost( subreddit="learnprogramming", send_replies=False )
See also
- await delete()¶
Delete the object.
Example usage:
comment = await reddit.comment("dkk4qjd", lazy=True) await comment.delete() submission = await reddit.submission("8dmv8z", lazy=True) await submission.delete()
- await disable_inbox_replies()¶
Disable inbox replies for the item.
Example usage:
comment = await reddit.comment("dkk4qjd", lazy=True) await comment.disable_inbox_replies() submission = await reddit.submission("8dmv8z", lazy=True) 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", lazy=True) await submission.downvote() comment = await reddit.comment(id="dxolpyc", lazy=True) await comment.downvote()
See also
- duplicates(**generator_kwargs: Union[str, int, Dict[str, str]]) AsyncIterator[asyncpraw.models.Submission] ¶
Return a
ListingGenerator
for the submission’s duplicates.Additional keyword arguments are passed in the initialization of
ListingGenerator
.Example usage:
submission = await reddit.submission(id="5or86n", lazy=True) async for duplicate in submission.duplicates(): # process each duplicate ...
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", lazy=True) await comment.enable_inbox_replies() submission = await reddit.submission("8dmv8z", lazy=True) await submission.enable_inbox_replies()
See also
- flair() asyncpraw.models.reddit.submission.SubmissionFlair ¶
Provide an instance of
SubmissionFlair
.This attribute is used to work with flair as a regular user of the subreddit the submission belongs to. Moderators can directly use
flair()
.For example, to select an arbitrary editable flair text (assuming there is one) and set a custom value try:
choices = await submission.flair.choices() template_id = next(x for x in choices if x["flair_text_editable"])["flair_template_id"] await submission.flair.select(template_id, "my custom value")
- 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
.
- await hide(other_submissions: Optional[List[asyncpraw.models.Submission]] = None)¶
Hide Submission.
- Parameters
other_submissions – When provided, additionally hide this list of
Submission
instances as part of a single request (default: None).
Example usage:
submission = await reddit.submission(id="5or86n", lazy=True) await submission.hide()
See also
- staticmethod id_from_url(url: str) str ¶
Return the ID contained within a submission URL.
- Parameters
url –
A url to a submission in one of the following formats (http urls will also work):
- Raises
InvalidURL
if URL is not a valid submission URL.
- 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_visited()¶
Mark submission as visited.
This method requires a subscription to reddit premium.
Example usage:
submission = await reddit.submission(id="5or86n", lazy=True) await submission.mark_visited()
- mod() asyncpraw.models.reddit.submission.SubmissionModeration ¶
Provide an instance of
SubmissionModeration
.Example usage:
submission = await reddit.submission(id="8dmv8z", lazy=True) await submission.mod.approve()
- 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 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", lazy=True) await submission.reply("reply") comment = await reddit.comment(id="dxolpyc", lazy=True) 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", lazy=True) await submission.report("report reason") comment = await reddit.comment(id="dxolpyc", lazy=True) 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", lazy=True) await submission.save(category="view later") comment = await reddit.comment(id="dxolpyc", lazy=True, lazy=True) await comment.save()
See also
- property shortlink: str¶
Return a shortlink to the submission.
For example, https://redd.it/eorhm is a shortlink for https://www.reddit.com/r/announcements/comments/eorhm/reddit_30_less_typing/.
- await unhide(other_submissions: Optional[List[asyncpraw.models.Submission]] = None)¶
Unhide Submission.
- Parameters
other_submissions – When provided, additionally unhide this list of
Submission
instances as part of a single request (default: None).
Example usage:
submission = await reddit.submission(id="5or86n") await submission.unhide()
See also
- await unsave()¶
Unsave the object.
Example usage:
submission = await reddit.submission(id="5or86n", lazy=True) await submission.unsave() comment = await reddit.comment(id="dxolpyc", lazy=True) 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", lazy=True) await submission.upvote() comment = await reddit.comment(id="dxolpyc", lazy=True) 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.