public async Task GetAllStreams(CommandContext ctx) { await ctx.Message.DeleteAsync(); var data = da.GetAllStreams(ctx.Guild.Id); File.WriteAllText("Members.json", JsonConvert.SerializeObject(JArray.FromObject(data))); var dmChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false); using (var fs = new FileStream("Members.json", FileMode.Open, FileAccess.Read)) { var msg = await new DiscordMessageBuilder() .WithContent("All Streams Attached") .WithFiles(new Dictionary <string, Stream>() { { "Members.json", fs } }) .SendAsync(ctx.Channel); } }