/
userlikecomments.go
43 lines (35 loc) · 1.14 KB
/
userlikecomments.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2017-2019 The Bitum developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package commands
// UserLikeCommentsCmd retreives the logged in user's like comment objects for
// the specified proposal.
type UserLikeCommentsCmd struct {
Args struct {
Token string `positional-arg-name:"token"` // Censorship token
} `positional-args:"true" required:"true"`
}
// Execute executes the user comment likes command.
func (cmd *UserLikeCommentsCmd) Execute(args []string) error {
cvr, err := client.UserCommentsLikes(cmd.Args.Token)
if err != nil {
return err
}
return printJSON(cvr)
}
// userLikeCommentsHelpMsg is the output for the help command when
// 'userlikecomments' is specified.
const userLikeCommentsHelpMsg = `userlikecomments "token"
Get the logged in user's comment upvote/downvotes for a proposal.
Arguments:
1. token (string, required) Proposal censorship token
Result:
{
"commentslikes": [
{
"action": (string) Vote (upvote or downvote)
"commentid" (string) ID of the comment
"token": (string) Proposal censorship token
},
]
}`