(
self, body: str, reply_to: RepositoryDiscussionComment | str | None = None, output_schema: str = "id"
)
| 160 | return PaginatedList(github.Reaction.Reaction, self._requester, firstData=self._reactions_page, firstHeaders={}) |
| 161 | |
| 162 | def add_comment( |
| 163 | self, body: str, reply_to: RepositoryDiscussionComment | str | None = None, output_schema: str = "id" |
| 164 | ) -> RepositoryDiscussionComment: |
| 165 | reply_to_id = ( |
| 166 | reply_to.id |
| 167 | if isinstance(reply_to, github.RepositoryDiscussionComment.RepositoryDiscussionComment) |
| 168 | else reply_to |
| 169 | ) |
| 170 | if not output_schema.startswith("\n"): |
| 171 | output_schema = f" {output_schema} " |
| 172 | |
| 173 | variables = {"body": body, "discussionId": self.id, "replyToId": reply_to_id} |
| 174 | return self._requester.graphql_named_mutation_class( |
| 175 | "addDiscussionComment", |
| 176 | NotSet.remove_unset_items(variables), |
| 177 | f"comment {{{output_schema}}}", |
| 178 | "comment", |
| 179 | github.RepositoryDiscussionComment.RepositoryDiscussionComment, |
| 180 | ) |
| 181 | |
| 182 | def _useAttributes(self, attributes: dict[str, Any]) -> None: |
| 183 | # super class is a REST API GithubObject, attributes are coming from GraphQL |
no test coverage detected