You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestConfig.cs 628 B

123456789101112131415161718192021
  1. using Newtonsoft.Json;
  2. using System.IO;
  3. namespace Discord
  4. {
  5. internal class TestConfig
  6. {
  7. [JsonProperty("token")]
  8. public string Token { get; private set; }
  9. [JsonProperty("guild_id")]
  10. public ulong GuildId { get; private set; }
  11. public static TestConfig LoadFile(string path)
  12. {
  13. using (var stream = new FileStream(path, FileMode.Open))
  14. using (var reader = new StreamReader(stream))
  15. using (var jsonReader = new JsonTextReader(reader))
  16. return new JsonSerializer().Deserialize<TestConfig>(jsonReader);
  17. }
  18. }
  19. }