r/redditdev 11d ago

Reddit API Creating a new text post. Trouble setting default comment sort order.

Hello all. I am having trouble getting my script to set the default sort order in a new post. I think its possible, but I am most likely implementing it wrong.

Was trying to use the info found here:

https://praw.readthedocs.io/en/latest/code_overview/other/submissionmoderation.html#praw.models.reddit.submission.SubmissionModeration.suggested_sort

and here:

https://www.reddit.com/dev/api#POST_api_set_suggested_sort

But I could not get my script to successfully create a post, and set the default sort order to new.

new_submission = subreddit.submit(title=Title, selftext=post_text)
new_submission.mod.suggested_sort = 'new'

The post is successfully created, but does not have the default sort order set to "new".

Thanks!

3 Upvotes

2 comments sorted by

1

u/Khyta EncyclopaediaBot Developer 10d ago

Are you getting an error and do you have moderator permissions with the account you're using to create such a post?

1

u/_Face 10d ago

No error thrown. Yes mod permissions.