praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
http://praw.readthedocs.io/
BSD 2-Clause "Simplified" License
3.47k stars 456 forks source link

subreddit.hot() has no time_filter option #1985

Closed MatteoRaso closed 11 months ago

MatteoRaso commented 11 months ago

Describe the Bug

When attempting to use

reddit.subreddit(sub_name).hot(time_filter="week")

I get the following error:

TypeError: ListingGenerator.__init__() got an unexpected keyword argument 'time_filter'

This doesn't happen when I switch hot to top.

Desired Result

The hot method should have a time filter.

Code to reproduce the bug

.subreddit("gaming").hot(time_filter="week")

The Reddit() initialization in my code example does not include the following parameters to prevent credential leakage:

client_secret, password, or refresh_token.

Relevant Logs

: ListingGenerator.__init__() got an unexpected keyword argument 'time_filter'

This code has previously worked as intended.

Not sure, I haven't used this code before.

Operating System/Environment

Linux Mint 21.2

Python Version

3.11.5

PRAW Version

7.7.1

Prawcore Version

2.4.0

Anything else?

No response

LilSpazJoekp commented 11 months ago

hot() does not accept the time_filter argument. See the docs here: https://praw.readthedocs.io/en/stable/code_overview/models/subreddit.html#praw.models.Subreddit.hot