Update StatsService.cs

This commit is contained in:
Master Kwoth 2017-07-12 16:11:18 +02:00 committed by GitHub
parent 06740fc9ab
commit d75dc4a2fb

View File

@ -117,6 +117,14 @@ namespace NadekoBot.Services.Impl
return Task.CompletedTask; return Task.CompletedTask;
}; };
var platform = "other";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
platform = "linux";
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
platform = "osx";
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
platform = "windows";
carbonitexTimer = new Timer(async (state) => carbonitexTimer = new Timer(async (state) =>
{ {
if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.CarbonKey)) if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.CarbonKey))
@ -151,7 +159,7 @@ namespace NadekoBot.Services.Impl
{ {
using (var content = new FormUrlEncodedContent( using (var content = new FormUrlEncodedContent(
new Dictionary<string, string> { new Dictionary<string, string> {
{ "id", string.Concat(MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(_creds.ClientId.ToString())).Select(x => x.ToString("X2"))) }, { "id", string.Concat(MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(NadekoBot.Credentials.ClientId.ToString())).Select(x => x.ToString("X2"))) },
{ "guildCount", _client.GetGuildCount().ToString() }, { "guildCount", _client.GetGuildCount().ToString() },
{ "version", BotVersion }, { "version", BotVersion },
{ "platform", platform }})) { "platform", platform }}))