Add info to game starts

This commit is contained in:
ekzyis 2024-10-18 21:36:43 +02:00
parent 392cf19ae6
commit 7a5b044b9d
1 changed files with 5 additions and 2 deletions

View File

@ -146,8 +146,11 @@ func handleGameStart(req *sn.Item) error {
return fmt.Errorf("failed to upload image for item %d: %v\n", req.Id, err) return fmt.Errorf("failed to upload image for item %d: %v\n", req.Id, err)
} }
// reply with algebraic notation and image // reply with algebraic notation, image and info
res = strings.Trim(fmt.Sprintf("%s\n\n%s", b.AlgebraicNotation(), imgUrl), " ") info := "_A new chess game has been started!_\n\n" +
"_Reply with a move like `d5` to continue the game. " +
"See [here](https://stacker.news/chess#how-to-continue) for details._"
res = strings.Trim(fmt.Sprintf("%s\n\n%s\n\n%s", b.AlgebraicNotation(), imgUrl, info), " ")
if _, err = createComment(req.Id, res); err != nil { if _, err = createComment(req.Id, res); err != nil {
return fmt.Errorf("failed to reply to item %d: %v\n", req.Id, err) return fmt.Errorf("failed to reply to item %d: %v\n", req.Id, err)
} }