func PlayerToMove(g *chess.Game) string {
	if g.Position().Turn() == chess.White {
		return tagPairValueForKey(g, "White")
	}
	return tagPairValueForKey(g, "Black")
}
PlayerToMove returns the name of the current player to move from the
"White" or "Black" tag pair.
package chessutil
import (
	"strconv"
	"strings"
	"time"
	"github.com/loganjspears/chess"
)
func NewGame(whitePlayer, blackPlayer string) *chess.Game {
	tagPairs := []*chess.TagPair{
		{Key: "Event", Value: "Casual game"},
		{Key: "Date", Value: time.Now().Format("2006.01.02")},  
		{Key: "White", Value: whitePlayer},
		{Key: "Black", Value: blackPlayer},
		{Key: "TimeControl", Value: "-"},
		{Key: "Annotator", Value: "slackchess"},
	}
	return chess.NewGame(chess.TagPairs(tagPairs))
}
func BotForColor(g *chess.Game, c chess.Color) (isBot bool, skillLvl int) {
	player := PlayerForColor(g, c)
	parts := strings.Split(player, ":")
	is := player == "slackbot" || (len(parts) > 0 && parts[0] == "slackbot")
	if is && len(parts) == 1 {
		return true, 10
	} else if is && len(parts) == 2 {
		i, err := strconv.Atoi(parts[1])
		if err == nil && (i >= 0 && i <= 20) {
			return true, i
		}
	}
	return false, 0
}
func AddDrawOffer(g *chess.Game, c chess.Color) *chess.Game {
	return addTag(g, "Draw Offer", c.String())
}
func RemoveDrawOffer(g *chess.Game) *chess.Game {
	return removeTag(g, "Draw Offer")
}
func DrawOfferColor(g *chess.Game) chess.Color {
	v := tagPairValueForKey(g, "Draw Offer")
	switch v {
	case chess.White.String():
		return chess.White
	case chess.Black.String():
		return chess.Black
	}
	return chess.NoColor
}