From 844c8356e7ba17f70a25e662d8d63730a74d3ef1 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 15 Oct 2020 00:14:50 -0700 Subject: [PATCH] fix class methods and var refs --- suchwow/reddit.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/suchwow/reddit.py b/suchwow/reddit.py index 08e4478..b51b249 100644 --- a/suchwow/reddit.py +++ b/suchwow/reddit.py @@ -1,10 +1,10 @@ -from praw import Reddit +import praw from suchwow import config class Reddit(object): def __init__(self): - self.reddit = Reddit( + self.reddit = praw.Reddit( client_id=config.PRAW_CLIENT_ID, client_secret=config.PRAW_CLIENT_SECRET, user_agent=config.PRAW_USER_AGENT, @@ -13,9 +13,9 @@ class Reddit(object): ) self.subreddit = "wownero" - def post(title, url): + def post(self, title, url): try: - submission = reddit.subreddit(self.subreddit).submit( + submission = self.reddit.subreddit(self.subreddit).submit( title=title, url=url, resubmit=False, @@ -24,7 +24,7 @@ class Reddit(object): except: return False - def comment(submission, post): + def comment(self, submission, post): try: submission.reply(f"Show this post love by sending WOW: {post.id}") except: