I have a bot for Reddit, built on Python 3 and PRAW 3.5. Essentially, it scans new posts in a sub, sends and reads private messages, and approves or deletes posts. If it approves a post it also comments on the post and both distinguishes it as an official mod post and stickies it.
It was originally built using a base Debian install in a virtual machine, and it works fine there. Unfortunately, on PythonAnywhere (free account) I get this error when it tries to distinguish and sticky a comment:
(<class 'TypeError'>, TypeError("distinguish() got an unexpected keyword argument 'sticky'",), <traceback object at 0x7fcba6575c08>)
My code to distinguish looks like this:
if not foundComment:
# No existing comment
comment_response = praw_post_object.add_comment(comment_text)
commentURL = 'https://www.reddit.com/r/{0}/comments/{1}/_/{2}'.format(cfg['subreddit'],comment_response.parent_id[3:],comment_response.id)
getCommentGenerator = r.get_submission(commentURL)
# Shouldn't need to do that but for some reason it wants it. test further.
getCommentGenerator.comments[0].distinguish(sticky = True)
From the error I would assume I'm on the wrong version of PRAW, but I've checked and double-checked and everything looks correct.
Sometimes I get occasional errors like this (exc_info() captured by the logging class):
(<class 'requests.exceptions.ConnectionError'>, ConnectionError(ProtocolError('Connection aborted.', BadStatusLine("''",)),), <traceback object at 0x7f525cc90308>)
and
(<class 'praw.errors.OAuthInvalidToken'>, OAuthInvalidToken(), <traceback object at 0x7f525cc93588>)
Both of which I'm assuming are "normal" errors with any recurring calls to an API or other service issues. The bot is resilient, it sleeps a bit and tries again and that's fine. But the sticky issue I can't sort out or work around no matter what I've tried. Everything else works just fine - sending and reading PMs, reading new posts, deleting and approving posts, and adding, editing, and distinguishing comments.
I know this isn't much to go on, any help is appreciated!