fix class methods and var refs
This commit is contained in:
parent
be59d6a2b3
commit
844c8356e7
|
@ -1,10 +1,10 @@
|
||||||
from praw import Reddit
|
import praw
|
||||||
from suchwow import config
|
from suchwow import config
|
||||||
|
|
||||||
|
|
||||||
class Reddit(object):
|
class Reddit(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.reddit = Reddit(
|
self.reddit = praw.Reddit(
|
||||||
client_id=config.PRAW_CLIENT_ID,
|
client_id=config.PRAW_CLIENT_ID,
|
||||||
client_secret=config.PRAW_CLIENT_SECRET,
|
client_secret=config.PRAW_CLIENT_SECRET,
|
||||||
user_agent=config.PRAW_USER_AGENT,
|
user_agent=config.PRAW_USER_AGENT,
|
||||||
|
@ -13,9 +13,9 @@ class Reddit(object):
|
||||||
)
|
)
|
||||||
self.subreddit = "wownero"
|
self.subreddit = "wownero"
|
||||||
|
|
||||||
def post(title, url):
|
def post(self, title, url):
|
||||||
try:
|
try:
|
||||||
submission = reddit.subreddit(self.subreddit).submit(
|
submission = self.reddit.subreddit(self.subreddit).submit(
|
||||||
title=title,
|
title=title,
|
||||||
url=url,
|
url=url,
|
||||||
resubmit=False,
|
resubmit=False,
|
||||||
|
@ -24,7 +24,7 @@ class Reddit(object):
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def comment(submission, post):
|
def comment(self, submission, post):
|
||||||
try:
|
try:
|
||||||
submission.reply(f"Show this post love by sending WOW: {post.id}")
|
submission.reply(f"Show this post love by sending WOW: {post.id}")
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue