Skip to content

Commit 53d59ce

Browse files
committed
Add !version
1 parent b966db5 commit 53d59ce

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ArchiSteamFarm/Bot.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ internal async Task<string> Response(ulong steamID, string message) {
375375
return ResponseStop(steamID);
376376
case "!update":
377377
return await ResponseUpdate(steamID).ConfigureAwait(false);
378+
case "!version":
379+
return ResponseVersion(steamID);
378380
default:
379381
return ResponseUnknown(steamID);
380382
}
@@ -1305,6 +1307,19 @@ private static async Task<string> ResponseUpdate(ulong steamID) {
13051307
return "Done!";
13061308
}
13071309

1310+
private string ResponseVersion(ulong steamID) {
1311+
if (steamID == 0) {
1312+
Logging.LogNullError(nameof(steamID));
1313+
return null;
1314+
}
1315+
1316+
if (!IsMaster(steamID)) {
1317+
return null;
1318+
}
1319+
1320+
return "ASF V" + Program.Version;
1321+
}
1322+
13081323
private void HandleCallbacks() {
13091324
TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep);
13101325
while (KeepRunning || SteamClient.IsConnected) {

ArchiSteamFarm/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ private static void Init(IEnumerable<string> args) {
433433
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
434434
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;
435435

436-
Logging.LogGenericInfo("Archi's Steam Farm, version " + Version);
436+
Logging.LogGenericInfo("ASF V" + Version);
437437
Directory.SetCurrentDirectory(ExecutableDirectory);
438438
InitServices();
439439

0 commit comments

Comments
 (0)