如何更改公会的图标?

时间:2018-08-02 20:49:13

标签: c# discord discord.net

我正在尝试更改公会图标,但是我不知道如何完成代码。 这就是我现在拥有的:

HttpClient dude = new HttpClient();
         var b= await dude.GetStreamAsync("somelink");
            Image pic = new Image();
            await Context.Guild.ModifyAsync(x => x.Icon = pic.Stream.

1 个答案:

答案 0 :(得分:0)

HttpClient link = new Httpclient();
var clonestream = new MemoryStream();
Stream stream = await link.GetStreamAsync("link");
stream.CopyTo(clonestream);
Image pic = new Image(clonestream);
clonestream.Position = 0;
await Context.Guild.ModifyAsync(x => x.Icon = pic);