Skip to content

Commit 637ae40

Browse files
committed
Add support for share.code-game.org/game join_secret property
1 parent f19454f commit 637ae40

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cmd/share_game.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@ var shareGameCmd = &cobra.Command{
5959
}
6060
}
6161

62+
joinSecret, err := cli.InputOptional("Join secret (optional):")
63+
abort(err)
64+
6265
type request struct {
63-
GameURL string `json:"game_url"`
64-
GameId string `json:"game_id"`
66+
GameURL string `json:"game_url"`
67+
GameId string `json:"game_id"`
68+
JoinSecret string `json:"join_secret,omitempty"`
6569
}
6670

6771
data := request{
68-
GameURL: gameURL,
69-
GameId: gameId,
72+
GameURL: gameURL,
73+
GameId: gameId,
74+
JoinSecret: joinSecret,
7075
}
7176

7277
jsonData, err := json.Marshal(data)

0 commit comments

Comments
 (0)