how to comment on a discussion with probot ? #1614
Answered
by
gr2m
anwarghammam
asked this question in
Q&A
-
how to comment on a discussion with probot ? when I know the "repo ,org and discussion number"? |
Beta Was this translation helpful? Give feedback.
Answered by
gr2m
Nov 15, 2021
Replies: 2 comments 2 replies
-
I don't think there are any REST APIs for discussions yet. You can use GraphQL though, e.g. to create a discussion you can use the const query = `
mutation ($discussionId: ID!, $body: String!) {
addDiscussionComment(input: {discussionId: $discussionId, body: $body}) {
comment {
url
}
}
}
`;
octokit.graphql(query, {
discussionId: "<discussion node id>",
body: "Discussion comment text",
}); You'll need to retrieve the node ID for the discussion first, the query for that could look like this
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
gr2m
-
it worked ! thank you a lot for your help |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think there are any REST APIs for discussions yet. You can use GraphQL though, e.g. to create a discussion you can use the
addDiscussionComment
mutationYou'll need to retrieve the node ID for the discussion first, the query for that could look like this