@@ -44,6 +44,28 @@ class Issue extends Requestable {
4444 this . _requestAllPages ( `/repos/${ this . __repository } /issues` , options , cb ) ;
4545 }
4646
47+ /**
48+ * List comments on an issue
49+ * @see https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue
50+ * @param {number } issue - the id of the issue to get comments from
51+ * @param {Requestable.callback } [cb] - will receive the comments
52+ * @return {Promise } - the promise for the http request
53+ */
54+ listIssueComments ( issue , cb ) {
55+ this . _request ( 'GET' , `/repos/${ this . __repository } /issues/${ issue } /comments` , null , cb ) ; // jscs:ignore
56+ }
57+
58+ /**
59+ * Get a single comment on an issue
60+ * @see https://developer.github.com/v3/issues/comments/#get-a-single-comment
61+ * @param {number } id - the comment id to get
62+ * @param {Requestable.callback } [cb] - will receive the comment
63+ * @return {Promise } - the promise for the http request
64+ */
65+ getIssueComment ( id , cb ) {
66+ this . _request ( 'GET' , `/repos/${ this . __repository } /issues/comments/${ id } ` , null , cb ) ; // jscs:ignore
67+ }
68+
4769 /**
4870 * Comment on an issue
4971 * @see https://developer.github.com/v3/issues/comments/#create-a-comment
@@ -56,6 +78,29 @@ class Issue extends Requestable {
5678 this . _request ( 'POST' , `/repos/${ this . __repository } /issues/${ issue } /comments` , { body : comment } , cb ) ; // jscs:ignore
5779 }
5880
81+ /**
82+ * Edit a comment on an issue
83+ * @see https://developer.github.com/v3/issues/comments/#edit-a-comment
84+ * @param {number } id - the comment id to edit
85+ * @param {string } comment - the comment to edit
86+ * @param {Requestable.callback } [cb] - will receive the edited comment
87+ * @return {Promise } - the promise for the http request
88+ */
89+ editIssueComment ( id , comment , cb ) {
90+ this . _request ( 'PATCH' , `/repos/${ this . __repository } /issues/comments/${ id } ` , { body : comment } , cb ) ; // jscs:ignore
91+ }
92+
93+ /**
94+ * Delete a comment on an issue
95+ * @see https://developer.github.com/v3/issues/comments/#delete-a-comment
96+ * @param {number } id - the comment id to delete
97+ * @param {Requestable.callback } [cb] - will receive true if the request is successful
98+ * @return {Promise } - the promise for the http request
99+ */
100+ deleteIssueComment ( id , cb ) {
101+ this . _request ( 'DELETE' , `/repos/${ this . __repository } /issues/comments/${ id } ` , null , cb ) ; // jscs:ignore
102+ }
103+
59104 /**
60105 * Edit an issue
61106 * @see https://developer.github.com/v3/issues/#edit-an-issue
0 commit comments