Fixed nicknames

This commit is contained in:
RogueException
2016-05-19 00:06:00 -03:00
parent fdbe41d77f
commit 473b1bdbbc

View File

@@ -80,7 +80,7 @@ namespace Discord.Rest
bool isCurrentUser = (await Discord.GetCurrentUser().ConfigureAwait(false)).Id == Id;
if (isCurrentUser && args.Nickname.IsSpecified)
{
var nickArgs = new ModifyCurrentUserNickParams { Nickname = args.Nickname.Value };
var nickArgs = new ModifyCurrentUserNickParams { Nickname = args.Nickname.Value ?? "" };
await Discord.ApiClient.ModifyCurrentUserNick(Guild.Id, nickArgs).ConfigureAwait(false);
args.Nickname = new API.Optional<string>(); //Remove
}
@@ -93,7 +93,7 @@ namespace Discord.Rest
if (args.Mute.IsSpecified)
IsMute = args.Mute.Value;
if (args.Nickname.IsSpecified)
Nickname = args.Nickname.Value;
Nickname = args.Nickname.Value ?? "";
if (args.Roles.IsSpecified)
_roles = args.Roles.Value.Select(x => Guild.GetRole(x)).Where(x => x != null).ToImmutableArray();
}