Skip to content

Commit

Permalink
Make playtime message more clear if a player was in the lobby during …
Browse files Browse the repository at this point in the history
…a bot restart
  • Loading branch information
matte-ek committed May 7, 2023
1 parent 381364b commit 18a52d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BanchoMultiplayerBot/Behaviour/FunCommandsBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ private async void OnUserMessage(IPrivateIrcMessage msg)
var totalPlaytime = TimeSpan.FromSeconds(user.Playtime) + currentPlaytime; // We add current play-time since it's only appended after the player disconnects.

_lobby.SendMessage(
$"{msg.Sender} has been here for {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)");
_lobby.Bot.StartTime.AddMinutes(2) >= player.JoinTime
? $"{msg.Sender} has been here since last bot restart, {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)"
: $"{msg.Sender} has been here for {currentPlaytime:h' hours 'm' minutes 's' seconds'} ({totalPlaytime:d' days 'h' hours 'm' minutes 's' seconds'} in total)");
}

if (msg.Content.ToLower().Equals("!playstats"))
Expand Down

0 comments on commit 18a52d3

Please sign in to comment.