M engine/api.go => engine/api.go +1 -3
@@ 297,9 297,7 @@ func GetPlayerStatus(uuid string) (bool, error) {
return online, nil
}
-// TODO: add functions for recentGames
-
-// Returns: (mode string,
+// Returns: (mode string, map string, ended f64)
func GetRecentGame(uuid string) (string, string, int, error) {
rawResponse, err := Hclient.RecentGamesByUUID(uuid)
if err != nil {
M engine/discord.go => engine/discord.go +3 -1
@@ 297,7 297,9 @@ func playerRecent(ctx *exrouter.Context) {
message += " They haven't played any Bed Wars games in the last hour. :("
} else {
// game was within hour
- message += " Their last game in Bed Wars " + gameMode + " on the " + gameMap + " map ended " + strconv.FormatFloat(timeSince.Minutes(), 'f', 2, 64) + " minutes ago. https://hypixel.fandom.com/wiki/" + gameMap
+ mapURL := "https://hypixel.fandom.com/wiki/" + strings.ReplaceAll(gameMap, " ", "_")
+ // TODO fix link in case of two words
+ message += " Their last game in Bed Wars " + gameMode + " on the " + gameMap + " map ended " + strconv.FormatFloat(timeSince.Minutes(), 'f', 2, 64) + " minutes ago. " + mapURL
}
// put together message