diff --git a/SlackAPI/Extensions.cs b/SlackAPI/Extensions.cs index 194a948..02d8d6e 100644 --- a/SlackAPI/Extensions.cs +++ b/SlackAPI/Extensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using Newtonsoft.Json; namespace SlackAPI @@ -17,10 +18,10 @@ public static string ToProperTimeStamp(this DateTime that, bool toUTC = true) { if (toUTC) { - return ((that.ToUniversalTime().Ticks - 621355968000000000m) / 10000000m).ToString("F6"); + return ((that.ToUniversalTime().Ticks - 621355968000000000m) / 10000000m).ToString("F6", CultureInfo.InvariantCulture); } else - return that.Subtract(new DateTime(1970, 1, 1)).TotalSeconds.ToString(); + return that.Subtract(new DateTime(1970, 1, 1)).TotalSeconds.ToString(CultureInfo.InvariantCulture); } public static K Deserialize(this string data) diff --git a/SlackAPI/JavascriptDateTimeConverter.cs b/SlackAPI/JavascriptDateTimeConverter.cs index d70d374..29117ba 100644 --- a/SlackAPI/JavascriptDateTimeConverter.cs +++ b/SlackAPI/JavascriptDateTimeConverter.cs @@ -20,7 +20,7 @@ public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectTy DateTime res = new DateTime(621355968000000000 + (long)(value * 10000000m)).ToLocalTime(); System.Diagnostics.Debug.Assert( Decimal.Equals( - Decimal.Parse(res.ToProperTimeStamp()), + Decimal.Parse(res.ToProperTimeStamp(), CultureInfo.InvariantCulture), Decimal.Parse(reader.Value.ToString(), CultureInfo.InvariantCulture)), "Precision loss :("); return res; diff --git a/SlackAPI/RPCMessages/AccessTokenResponse.cs b/SlackAPI/RPCMessages/AccessTokenResponse.cs index ebf9fb9..865d9fa 100644 --- a/SlackAPI/RPCMessages/AccessTokenResponse.cs +++ b/SlackAPI/RPCMessages/AccessTokenResponse.cs @@ -12,6 +12,24 @@ public class AccessTokenResponse : Response public string access_token; public string scope; public string team_name; - public Bot bot; + public string team_id { get; set; } + public BotTokenResponse bot; + } + + public class BotTokenResponse + { + public string emoji; + public string image_24; + public string image_32; + public string image_48; + public string image_72; + public string image_192; + + public bool deleted; + public UserProfile icons; + public string id; + public string name; + public string bot_user_id; + public string bot_access_token; } }