Using declarations and other code reformats

This commit is contained in:
Kwoth
2021-12-26 03:22:45 +01:00
parent d18f9429c6
commit b85ba177cd
64 changed files with 2349 additions and 2736 deletions

View File

@@ -57,24 +57,22 @@ public partial class Games : NadekoModule<GamesService>
return;
}
await using (var imgStream = new MemoryStream())
await using var imgStream = new MemoryStream();
lock (gr)
{
lock (gr)
{
originalStream.Position = 0;
originalStream.CopyTo(imgStream);
}
imgStream.Position = 0;
await ctx.Channel.SendFileAsync(stream: imgStream,
filename: $"girl_{usr}.png",
text: Format.Bold($"{ctx.User.Mention} Girl Rating For {usr}"),
embed: _eb.Create()
.WithOkColor()
.AddField("Hot", gr.Hot.ToString("F2"), true)
.AddField("Crazy", gr.Crazy.ToString("F2"), true)
.AddField("Advice", gr.Advice, false)
.Build()).ConfigureAwait(false);
originalStream.Position = 0;
originalStream.CopyTo(imgStream);
}
imgStream.Position = 0;
await ctx.Channel.SendFileAsync(stream: imgStream,
filename: $"girl_{usr}.png",
text: Format.Bold($"{ctx.User.Mention} Girl Rating For {usr}"),
embed: _eb.Create()
.WithOkColor()
.AddField("Hot", gr.Hot.ToString("F2"), true)
.AddField("Crazy", gr.Crazy.ToString("F2"), true)
.AddField("Advice", gr.Advice, false)
.Build()).ConfigureAwait(false);
}
private double NextDouble(double x, double y)