Browse Source

Merge pull request #54 from 420foxbot/patch-user-nickname

Add Nicknames to User Model; Bump README to 0.9.1
pull/55/head
RogueException 9 years ago
parent
commit
5042ae22dd
3 changed files with 8 additions and 2 deletions
  1. +2
    -2
      README.md
  2. +2
    -0
      src/Discord.Net/API/Client/Common/Member.cs
  3. +4
    -0
      src/Discord.Net/Models/User.cs

+ 2
- 2
README.md View File

@@ -1,9 +1,9 @@
# Discord.Net v0.9.0-rc4
# Discord.Net v0.9.1
[![Build status](https://ci.appveyor.com/api/projects/status/p0n69xhqgmoobycf/branch/master?svg=true)](https://ci.appveyor.com/project/foxbot/discord-net/branch/master)

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.
It's current being rewritten. Until that's done, feel free to use my [DiscordBot](https://github.com/RogueException/DiscordBot) repo for reference.


+ 2
- 0
src/Discord.Net/API/Client/Common/Member.cs View File

@@ -10,5 +10,7 @@ namespace Discord.API.Client
public DateTime? JoinedAt { get; set; }
[JsonProperty("roles"), JsonConverter(typeof(LongStringArrayConverter))]
public ulong[] Roles { get; set; }
[JsonProperty("nick")]
public string Nick { get; set; } = "";
}
}

+ 4
- 0
src/Discord.Net/Models/User.cs View File

@@ -58,6 +58,8 @@ namespace Discord
public string Name { get; private set; }
/// <summary> Gets an id uniquely identifying from others with the same name. </summary>
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>
public string AvatarId { get; private set; }
/// <summary> Gets the name of the game this user is currently playing. </summary>
@@ -175,6 +177,8 @@ namespace Discord
JoinedAt = model.JoinedAt.Value;
if (model.Roles != null)
UpdateRoles(model.Roles.Select(x => Server.GetRole(x)));
if (model.Nick != "")
Nickname = model.Nick;
}
internal void Update(ExtendedMember model)
{


Loading…
Cancel
Save