Closed ghost closed 11 months ago
I believe the underlying endpoint requires it to be provided. You can still post without a selftext but you have to specify selftext=""
.
@LilSpazJoekp You're right, that worked. I hadn't tried providing an empty string explicitly, but was just trying to submit it without the parameter entirely. Thanks!
Describe the Bug
In this section of
/praw/models/reddit/subreddit.py
, the following code appears:Should this be adjusted? It's possible to submit a title-only post without any
selftext
orurl
through the site's UI. Currently, it seems like it isn't possible to do that through PRAW since it needs one or the other of these parameters.If these three lines were removed outright, the result would be that
PRAW
will always prioritizeselftext
overurl
. A few lines down from the above code, here, the following check is implemented:Which effectively ignores
url
if bothselftext
andurl
are provided. The docs could be updated to reflect this, or an error could be raised at this point alerting the requester that both cannot be provided.Desired Result
The ability to submit with only the
title
parameter, and neither ofselftext
orurl
.Code to reproduce the bug
My code does not include sensitive credentials
Relevant Logs
This code has previously worked as intended
I'm not sure, I haven't used this code before.
Operating System/Environment
Windows 10
Python Version
3.12.0
PRAW Version
7.7.1
Links, references, and/or additional comments?
No response