@@ -337,18 +337,7 @@ def get_pr_author(self) -> str:
337337
338338 def get_pr_comments (self ):
339339 """Download the PR review comments using the comfort-fade preview headers"""
340-
341- def get_element (
342- requester : Requester , headers : dict , element : dict , completed : bool
343- ):
344- return element
345-
346- return PaginatedList (
347- get_element ,
348- self .pull_request ._requester ,
349- self .pull_request .review_comments_url ,
350- None ,
351- )
340+ return self .pull_request .get_review_comments ()
352341
353342 def post_lgtm_comment (self , body : str ):
354343 """Post a "LGTM" comment if everything's clean, making sure not to spam"""
@@ -359,7 +348,7 @@ def post_lgtm_comment(self, body: str):
359348 comments = self .get_pr_comments ()
360349
361350 for comment in comments :
362- if comment [ " body" ] == body :
351+ if comment . body == body :
363352 print ("Already posted, no need to update" )
364353 return
365354
@@ -1240,7 +1229,10 @@ def cull_comments(pull_request: PullRequest, review, max_comments):
12401229 """
12411230
12421231 unposted_comments = {HashableComment (** c ) for c in review ["comments" ]}
1243- posted_comments = {HashableComment (** c ) for c in pull_request .get_pr_comments ()}
1232+ posted_comments = {
1233+ HashableComment (c .body , c .line or c .original_line , c .path , c .side )
1234+ for c in pull_request .get_pr_comments ()
1235+ }
12441236
12451237 review ["comments" ] = [
12461238 c .__dict__ for c in sorted (unposted_comments - posted_comments )
0 commit comments