Added '--version' which outputs the bot's version
using '--version' during bot execution outputs the bot's version modify how app version is retrieved modify casing of 'unknown' version
This commit is contained in:
parent
0ead1290e9
commit
81677ee761
1 changed files with 14 additions and 2 deletions
|
@ -1,4 +1,17 @@
|
|||
var shardId = 0;
|
||||
using System.Reflection;
|
||||
|
||||
static string GetAppVersion()
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown";
|
||||
}
|
||||
|
||||
if (args.Length > 0 && args[0] == "--version")
|
||||
{
|
||||
Console.WriteLine(GetAppVersion());
|
||||
return;
|
||||
}
|
||||
|
||||
var shardId = 0;
|
||||
int? totalShards = null; // 0 to read from creds.yml
|
||||
if (args.Length > 0 && args[0] != "run")
|
||||
{
|
||||
|
@ -20,5 +33,4 @@ if (args.Length > 0 && args[0] != "run")
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
await new Bot(shardId, totalShards).RunAndBlockAsync();
|
Loading…
Add table
Reference in a new issue