Add !version

This commit is contained in:
JustArchi
2016-06-06 05:27:11 +02:00
parent b966db5845
commit 53d59ce2a9
2 changed files with 16 additions and 1 deletions

View File

@@ -375,6 +375,8 @@ namespace ArchiSteamFarm {
return ResponseStop(steamID);
case "!update":
return await ResponseUpdate(steamID).ConfigureAwait(false);
case "!version":
return ResponseVersion(steamID);
default:
return ResponseUnknown(steamID);
}
@@ -1305,6 +1307,19 @@ namespace ArchiSteamFarm {
return "Done!";
}
private string ResponseVersion(ulong steamID) {
if (steamID == 0) {
Logging.LogNullError(nameof(steamID));
return null;
}
if (!IsMaster(steamID)) {
return null;
}
return "ASF V" + Program.Version;
}
private void HandleCallbacks() {
TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep);
while (KeepRunning || SteamClient.IsConnected) {

View File

@@ -433,7 +433,7 @@ namespace ArchiSteamFarm {
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;
Logging.LogGenericInfo("Archi's Steam Farm, version " + Version);
Logging.LogGenericInfo("ASF V" + Version);
Directory.SetCurrentDirectory(ExecutableDirectory);
InitServices();