fix class methods and var refs

graphs-n-shit
lza_menace 4 years ago
parent be59d6a2b3
commit 844c8356e7

@ -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:

Loading…
Cancel
Save