Exemplo n.º 1
0
        /// <summary> Load the configuration from the path specified in FileName. </summary>
        public static async Task <DiscordClientConfiguration> LoadAsync()
        {
            string filePath = Path.Combine(AppContext.BaseDirectory, fileName);
            string json     = await MonkeyHelpers.ReadTextAsync(filePath).ConfigureAwait(false);

            DiscordClientConfiguration config = JsonConvert.DeserializeObject <DiscordClientConfiguration>(json);

            return(config);
        }
Exemplo n.º 2
0
 /// <summary> Save the configuration to the path specified in FileName. </summary>
 public async Task SaveAsync()
 {
     string filePath = Path.Combine(AppContext.BaseDirectory, fileName);
     await MonkeyHelpers.WriteTextAsync(filePath, ToJson()).ConfigureAwait(false);
 }