Skip to content

Commit

Permalink
Add comment on issue example (#2081)
Browse files Browse the repository at this point in the history
Add an example showing how to comment on an existing issue.
  • Loading branch information
ilovechai committed Oct 20, 2021
1 parent 70cc819 commit 3f76764
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion doc/examples/Issue.rst
Expand Up @@ -9,6 +9,16 @@ Get issue
>>> repo = g.get_repo("PyGithub/PyGithub")
>>> repo.get_issue(number=874)
Issue(title="PyGithub example usage", number=874)
Create comment on issue
-----------------------

.. code-block:: python
>>> repo = g.get_repo("PyGithub/PyGithub")
>>> issue = repo.get_issue(number=874)
>>> issue.create_comment("Test")
IssueComment(user=NamedUser(login="user"), id=36763078)
Create issue
------------
Expand Down Expand Up @@ -65,4 +75,4 @@ Close all issues
>>> repo = g.get_repo("PyGithub/PyGithub")
>>> open_issues = repo.get_issues(state='open')
>>> for issue in open_issues:
... issue.edit(state='closed')
... issue.edit(state='closed')

0 comments on commit 3f76764

Please sign in to comment.