How to use the apraw.models.Comment function in aPRAW

To help you get started, we’ve selected a few aPRAW examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Dan6erbond / aPRAW / tests / integration / models / test_subreddit.py View on Github external
async def test_subreddit_moderation_listing(self, reddit):
        subreddit = await reddit.subreddit("aprawtest")
        report = None

        async for rep in subreddit.mod.reports():
            report = rep
            break

        assert isinstance(
            report, apraw.models.Submission) or isinstance(
            report, apraw.models.Comment)
github Dan6erbond / aPRAW / tests / integration / models / test_submission.py View on Github external
async def test_submission_morechildren(self, reddit):
        submission = await reddit.submission("h7mna9")
        children = []

        async for comment in submission.comments():
            children.append(comment.id)

        async for comment in submission.morechildren(children):
            assert isinstance(comment, apraw.models.Comment)
github Dan6erbond / aPRAW / tests / integration / models / test_user.py View on Github external
async def test_user_inbox(self, reddit):
        user = await reddit.user.me()

        async for item in user.inbox():
            assert isinstance(item, apraw.models.Comment) or isinstance(item, apraw.models.Message)
github Dan6erbond / aPRAW / tests / integration / models / test_comment.py View on Github external
def scan_comments(c):
            for reply in c.replies:
                assert isinstance(reply, apraw.models.Comment)
                scan_comments(reply)
github Dan6erbond / aPRAW / tests / integration / models / test_user.py View on Github external
async def test_user_unread(self, reddit):
        user = await reddit.user.me()

        async for item in user.unread():
            assert isinstance(item, apraw.models.Comment) or isinstance(item, apraw.models.Message)
github Dan6erbond / aPRAW / apraw / reddit.py View on Github external
id: str
            The ID of a comment (with or without kind).
        url: str
            The URL of a comment.

        Returns
        -------
        comment: Comment
            The requested comment.
        """
        if id != "":
            comment = Comment(self, {"id": id})
            await comment.fetch()
            return comment
        else:
            comment = Comment(self, {"url": url})
            await comment.fetch()
            return comment