Python PRAW Subreddit Object : "got an unexpected keyword argument 'timeFilter'"

364 Views Asked by At

when specifying a time filter on a subreddit object on praw, it says: " __ init __() got an unexpected keyword argument 'timeFilter'"( the code is called within the __ init __() of a class ).

sortingType = 0
timeFilterId = 0

sortingFunctionTypes = { 
    0 : 'hot',
    1 : 'top',
    2 : 'new',
    3 : 'rising',
    4 : 'controversial'
}   

timeFilters = {
    0 : "all",
    1 : "day",
    2 : "hour",
    3 : "month",
    4 : "week",
    5 : "year"
}

subreddit = self.reddit.subreddit(redditString)
sortingFunction = getattr(subreddit, sortingFunctionTypes.get(sortingType))
self.posts =sortingFunction(limit=postLimit,timeFilter=timeFilters.get(timeFilterId))

Now although I am not calling the function normally, it should still work, as the limit keyword does,and yet it doesn't.

Is there something I'm missing?

1

There are 1 best solutions below

0
Gab Tro On

It has been resolved, only top and controversial support the time_filter keyword.