Skip to content

Error fetching comment by ID #336

@uukelele-scratch

Description

@uukelele-scratch
Traceback (most recent call last):
  File "main.py", line 160, in replyComment
    comment_obj = user.comment_by_id(commentID)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/scratchattach/site/user.py", line 730, in comment_by_id
    results = list(filter(lambda x : str(x.id) == str(comment_id), page_content))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

When I'm replying using the ID of a root-level comment it works fine, but as soon as I attempt to reply using the ID of a reply this error is thrown.

I can't even try replying to the comment with its parent, as I can't even get the comment_obj.

Here's more of my code:

def replyComment(comment, user, commentID):
        user = session.connect_user(user)
        comment_obj = user.comment_by_id(commentID)
        comment_obj.reply(comment)
        return "Comment replied to successfully!"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions