Add Nicknames to User Model; Bump README to 0.9.1pull/55/head
@@ -1,9 +1,9 @@ | |||||
# Discord.Net v0.9.0-rc4 | |||||
# Discord.Net v0.9.1 | |||||
[](https://ci.appveyor.com/project/foxbot/discord-net/branch/master) | [](https://ci.appveyor.com/project/foxbot/discord-net/branch/master) | ||||
An unofficial .Net API Wrapper for the Discord client (http://discordapp.com). | An unofficial .Net API Wrapper for the Discord client (http://discordapp.com). | ||||
Check out the [documentation](https://discordnet.readthedocs.org/en/latest/) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx). | |||||
Check out the [documentation](http://rtd.discord.foxbot.me/en/docs-dev/index.html) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx). | |||||
##### Warning: Some of the documentation is outdated. | ##### Warning: Some of the documentation is outdated. | ||||
It's current being rewritten. Until that's done, feel free to use my [DiscordBot](https://github.com/RogueException/DiscordBot) repo for reference. | It's current being rewritten. Until that's done, feel free to use my [DiscordBot](https://github.com/RogueException/DiscordBot) repo for reference. | ||||
@@ -10,5 +10,7 @@ namespace Discord.API.Client | |||||
public DateTime? JoinedAt { get; set; } | public DateTime? JoinedAt { get; set; } | ||||
[JsonProperty("roles"), JsonConverter(typeof(LongStringArrayConverter))] | [JsonProperty("roles"), JsonConverter(typeof(LongStringArrayConverter))] | ||||
public ulong[] Roles { get; set; } | public ulong[] Roles { get; set; } | ||||
[JsonProperty("nick")] | |||||
public string Nick { get; set; } = ""; | |||||
} | } | ||||
} | } |
@@ -58,6 +58,8 @@ namespace Discord | |||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <summary> Gets an id uniquely identifying from others with the same name. </summary> | /// <summary> Gets an id uniquely identifying from others with the same name. </summary> | ||||
public ushort Discriminator { get; private set; } | public ushort Discriminator { get; private set; } | ||||
/// <summary> Gets a user's nickname in a server </summary> | |||||
public string Nickname { get; internal set; } | |||||
/// <summary> Gets the unique identifier for this user's current avatar. </summary> | /// <summary> Gets the unique identifier for this user's current avatar. </summary> | ||||
public string AvatarId { get; private set; } | public string AvatarId { get; private set; } | ||||
/// <summary> Gets the name of the game this user is currently playing. </summary> | /// <summary> Gets the name of the game this user is currently playing. </summary> | ||||
@@ -175,6 +177,8 @@ namespace Discord | |||||
JoinedAt = model.JoinedAt.Value; | JoinedAt = model.JoinedAt.Value; | ||||
if (model.Roles != null) | if (model.Roles != null) | ||||
UpdateRoles(model.Roles.Select(x => Server.GetRole(x))); | UpdateRoles(model.Roles.Select(x => Server.GetRole(x))); | ||||
if (model.Nick != "") | |||||
Nickname = model.Nick; | |||||
} | } | ||||
internal void Update(ExtendedMember model) | internal void Update(ExtendedMember model) | ||||
{ | { | ||||