diff --git a/services/grid-bot/lib/commands/PrivateModules/Commands/Settings.cs b/services/grid-bot/lib/commands/PrivateModules/Commands/Settings.cs index 7d7e8ba7..af69411d 100755 --- a/services/grid-bot/lib/commands/PrivateModules/Commands/Settings.cs +++ b/services/grid-bot/lib/commands/PrivateModules/Commands/Settings.cs @@ -19,6 +19,8 @@ namespace Grid.Bot.Commands.Private; using Utility; using Extensions; +using System.Text.Json; + /// /// Represents the interaction for settings. @@ -137,7 +139,15 @@ public async Task GetAllAsync(string provider, bool refresh = true) if (refresh) instance.Refresh(); - using var stream = new MemoryStream(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(instance.GetRawValues(), Formatting.Indented))); + /* FIXME: This is stupid, update 1.1.0 on Configuration should convert these on each refresh instead of placing a JE dict in cache. */ + + var values = new Dictionary(); + + foreach (var kvp in instance.GetRawValues()) + if (kvp.Value is JsonElement element) + values.Add(kvp.Key, element.GetString()); + + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(values, Formatting.Indented))); await this.ReplyWithFileAsync(stream, $"{provider}.json", "Here are the settings for the specified provider."); }