src/reddit_bot.py
def retrieve_comments(self):
        """Retrieves comments from subreddits, filters for keyword trigger, and
        excludes processed comments.

        Returns
        -------
        generator
            Dict of reddit.Comment and query.

        """
        try:
            print("Retrieving {} comments...".format(self.retrieval_limit))
            comments = self.reddit.subreddit(self.subreddits).comments(
                limit=self.retrieval_limit
                )
            for comment in comments:
                if (comment.author != self.username
                        and comment not in self.processed_comments
                        #and not self.has_already_replied(comment)
                        #and not self.is_summon_chain(comment)
                   ):
                    query = self.keyword.search(comment.body.lower())
                    if query:
                        self.processed_comments.append(comment.id)
                        yield {'comment': comment, 'query' : query.group(1)}
        except praw.exceptions.APIException as error:
            print("API Error:", error)
            raise
        except AttributeError as error:
            print(error)
            print("Unable to retrieve comments.")
            raise
Retrieves comments from subreddits, filters for keyword trigger, and
        excludes processed comments.

        Returns
        -------
        generator
            Dict of reddit.Comment and query.

        
Retrieves comments from subreddits, filters for keyword trigger, and
excludes processed comments.

Returns

generator
Dict of reddit.Comment and query.
Retrieves comments from subreddits filters for keyword trigger and excludes processed comments . Returns generator Dict of reddit . Comment and query .
def retrieve_comments(self):
        try:
            print("Retrieving {} comments...".format(self.retrieval_limit))
            comments = self.reddit.subreddit(self.subreddits).comments(
                limit=self.retrieval_limit
                )
            for comment in comments:
                if (comment.author != self.username
                        and comment not in self.processed_comments
                   ):
                    query = self.keyword.search(comment.body.lower())
                    if query:
                        self.processed_comments.append(comment.id)
                        yield {'comment': comment, 'query' : query.group(1)}
        except praw.exceptions.APIException as error:
            print("API Error:", error)
            raise
        except AttributeError as error:
            print(error)
            print("Unable to retrieve comments.")
            raise
def retrieve_comments ( self ) : try : print ( "Retrieving {} comments..." . format ( self . retrieval_limit ) ) comments = self . reddit . subreddit ( self . subreddits ) . comments ( limit = self . retrieval_limit ) for comment in comments : if ( comment . author != self . username and comment not in self . processed_comments ) : query = self . keyword . search ( comment . body . lower ( ) ) if query : self . processed_comments . append ( comment . id ) yield { 'comment' : comment , 'query' : query . group ( 1 ) } except praw . exceptions . APIException as error : print ( "API Error:" , error ) raise except AttributeError as error : print ( error ) print ( "Unable to retrieve comments." ) raise
Retrieves comments from subreddits, filters for keyword trigger, and
excludes processed comments.
Retrieves comments from subreddits filters for keyword trigger and excludes processed comments .
"""Retrieves comments from subreddits, filters for keyword trigger, and
        excludes processed comments.

        Returns
        -------
        generator
            Dict of reddit.Comment and query.

        """ #and not self.has_already_replied(comment) #and not self.is_summon_chain(comment)
self