Fix CreateGuildAsync not sending icon stream. (#768)

* Fix CreateGuildAsync not doing anything with the input stream for the guild icon.

Also fixes an issue with potential stream types that throw a NotSupportedException when checking its properties. [Apparently, they exist.](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs)

* Merged with old method

* Removed duplicate decl
This commit is contained in:
Alex Gravely
2017-08-17 02:19:16 -04:00
committed by RogueException
parent 506a6c96c9
commit 865080add9
2 changed files with 23 additions and 5 deletions

View File

@@ -120,6 +120,9 @@ namespace Discord.Rest
string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options)
{
var args = new CreateGuildParams(name, region.Id);
if (jpegIcon != null)
args.Icon = new API.Image(jpegIcon);
var model = await client.ApiClient.CreateGuildAsync(args, options).ConfigureAwait(false);
return RestGuild.Create(client, model);
}