I'm trying to build a when I get a message on Reddit to display an alert on my device and tell it the author. Something like this:
I tried searching for Reddit's documentation but I didn't find anything on the matter including the PRAW's docs, Reddit's API docs, and on their Subreddit. I even tried
from pync import Notifier
print "Booting up..."
print "Searching for messages..."
r = praw.Reddit(user_agent='RedditNotifier version 0.0.1')
for msg in r.get_unread(limit=None):
if not msg:
Notifier.notify('From:' + 'Author here', title='Reddit: New Message!', open='https://www.reddit.com/message/unread/')
I don't know how you couldn't find it in the PRAW docs because a quick google search "praw author" gave me this Stack Overflow answer.
A comment has an
author attribute, which is a
Redditor object. And to get the name from the
Redditor object, use its
EDIT: So what you to do is replace
'Author here' with