Add !uptime command
This commit is contained in:
@@ -154,6 +154,8 @@ namespace Torch.API
|
||||
/// Raised when the server's Init() method has completed.
|
||||
/// </summary>
|
||||
event Action<ITorchServer> Initialized;
|
||||
|
||||
TimeSpan ElapsedPlayTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -290,5 +290,11 @@ namespace Torch.Commands
|
||||
}
|
||||
}, this, TaskContinuationOptions.RunContinuationsAsynchronously);
|
||||
}
|
||||
|
||||
[Command("uptime", "Check how long the server has been online.")]
|
||||
public void Uptime()
|
||||
{
|
||||
Context.Respond(((ITorchServer)Context.Torch).ElapsedPlayTime.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user