MCPcopy Create free account
hub / github.com/GetStream/stream-cli / getCmd

Function getCmd

pkg/cmd/chat/reaction/reaction.go:20–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func getCmd() *cobra.Command {
21 cmd := &cobra.Command{
22 Use: "get-reactions [message-id]",
23 Short: "Get reactions for a message",
24 Example: heredoc.Doc(`
25 # Get reactions for a [08f64828-3bba-42bd-8430-c26a3634ee5c] message
26 $ stream-cli chat get-reactions 08f64828-3bba-42bd-8430-c26a3634ee5c --output-format json
27 `),
28 Args: cobra.ExactArgs(1),
29 RunE: func(cmd *cobra.Command, args []string) error {
30 c, err := config.GetConfig(cmd).GetClient(cmd)
31 if err != nil {
32 return err
33 }
34
35 msgID := args[0]
36
37 resp, err := c.GetReactions(cmd.Context(), msgID, nil)
38 if err != nil {
39 return err
40 }
41
42 return utils.PrintObject(cmd, resp.Reactions)
43 },
44 }
45
46 fl := cmd.Flags()
47 fl.StringP("output-format", "o", "json", "[optional] Output format. Can be json or tree")
48
49 return cmd
50}
51
52func sendCmd() *cobra.Command {
53 cmd := &cobra.Command{

Callers 1

NewCmdsFunction · 0.70

Calls 3

GetConfigFunction · 0.92
PrintObjectFunction · 0.92
GetClientMethod · 0.80

Tested by

no test coverage detected