From 8ae78f19892d80864b677a512a8495a54a8c67a3 Mon Sep 17 00:00:00 2001 From: RogueException Date: Fri, 16 Oct 2015 23:38:14 -0300 Subject: [PATCH] Modify the cache with EditServer's response --- src/Discord.Net/DiscordClient.API.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net/DiscordClient.API.cs b/src/Discord.Net/DiscordClient.API.cs index 780c1974a..de9e94125 100644 --- a/src/Discord.Net/DiscordClient.API.cs +++ b/src/Discord.Net/DiscordClient.API.cs @@ -769,12 +769,15 @@ namespace Discord public Task EditServer(Server server) => EditServer(server?.Id); /// Edits the provided server, changing only non-null attributes. - public Task EditServer(string serverId, string name = null, string region = null) + public async Task EditServer(string serverId, string name = null, string region = null) { CheckReady(); if (serverId == null) throw new ArgumentNullException(nameof(serverId)); - return _api.EditServer(serverId, name: name, region: region); + var response = await _api.EditServer(serverId, name: name, region: region); + var server = _servers[response.Id]; + if (server != null) + server.Update(response); } /// Leaves the provided server, destroying it if you are the owner.