MCPcopy Index your code
hub / github.com/google/go-github / CreateCommentReaction

Method CreateCommentReaction

github/reactions.go:96–114  ·  view source on GitHub ↗

CreateCommentReaction creates a reaction for a commit comment. Note that if you have already created a reaction of type content, the previously created reaction will be returned with Status: 200 OK. The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hoora

(ctx context.Context, owner, repo string, id int64, content string)

Source from the content-addressed store, hash-verified

94//
95//meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions
96func (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {
97 u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id)
98
99 body := &Reaction{Content: &content}
100 req, err := s.client.NewRequest(ctx, "POST", u, body)
101 if err != nil {
102 return nil, nil, err
103 }
104
105 req.Header.Set("Accept", mediaTypeReactionsPreview)
106
107 var m *Reaction
108 resp, err := s.client.Do(req, &m)
109 if err != nil {
110 return nil, resp, err
111 }
112
113 return m, resp, nil
114}
115
116// DeleteCommentReaction deletes the reaction for a commit comment.
117//

Calls 2

NewRequestMethod · 0.80
DoMethod · 0.45