8000 Add create_comment method for pull requests · Teino1978-Corp/github3.py@55d8637 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55d8637

Browse files
committed
Add create_comment method for pull requests
1 parent 87de595 commit 55d8637

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

github3/pulls.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .repos.commit import RepoCommit
1717
from .users import User
1818
from .decorators import requires_auth
19+
from .issues import Issue
1920
from .issues.comment import IssueComment
2021
from uritemplate import URITemplate
2122

@@ -207,6 +208,18 @@ def close(self):
207208
"""
208209
return self.update(self.title, self.body, 'closed')
209210

211+
@requires_auth
212+
def create_comment(self, body):
213+
"""Create a comment on this pull request's issue.
214+
215+
:param str body: (required), comment body
216+
:returns: :class:`IssueComment <github3.issues.comment.IssueComment>`
217+
"""
218+
response = self._get(self.issue_url)
219+
json = self._json(response, 200)
220+
issue = self._instance_or_null(Issue, json)
221+
return issue.create_comment(body)
222+
210223
@requires_auth
211224
def create_review_comment(self, body, commit_id, path, position):
212225
"""Create a review comment on this pull request.

0 commit comments

Comments
 (0)
0