Added more JsonIgnores
This commit is contained in:
@@ -61,9 +61,11 @@ namespace Discord
|
|||||||
public IEnumerable<Role> Roles => RoleIds.Select(x => _client.Roles[x]);
|
public IEnumerable<Role> Roles => RoleIds.Select(x => _client.Roles[x]);
|
||||||
|
|
||||||
/// <summary> Returns a collection of all messages this user has sent on this server that are still in cache. </summary>
|
/// <summary> Returns a collection of all messages this user has sent on this server that are still in cache. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Message> Messages => _client.Messages.Where(x => x.UserId == UserId && x.ServerId == ServerId);
|
public IEnumerable<Message> Messages => _client.Messages.Where(x => x.UserId == UserId && x.ServerId == ServerId);
|
||||||
|
|
||||||
/// <summary> Returns a collection of all channels this user is a member of. </summary>
|
/// <summary> Returns a collection of all channels this user is a member of. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Channel> Channels => _client.Channels.Where(x => x.ServerId == ServerId && x.UserIds.Contains(UserId));
|
public IEnumerable<Channel> Channels => _client.Channels.Where(x => x.ServerId == ServerId && x.UserIds.Contains(UserId));
|
||||||
|
|
||||||
internal Member(DiscordClient client, string userId, string serverId)
|
internal Member(DiscordClient client, string userId, string serverId)
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ namespace Discord
|
|||||||
/// <summary> Returns true if this is the role representing all users in a server. </summary>
|
/// <summary> Returns true if this is the role representing all users in a server. </summary>
|
||||||
public bool IsEveryone { get; }
|
public bool IsEveryone { get; }
|
||||||
/// <summary> Returns a list of the ids of all members in this role. </summary>
|
/// <summary> Returns a list of the ids of all members in this role. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<string> MemberIds => IsEveryone ? Server.UserIds : Server.Members.Where(x => x.RoleIds.Contains(Id)).Select(x => x.UserId);
|
public IEnumerable<string> MemberIds => IsEveryone ? Server.UserIds : Server.Members.Where(x => x.RoleIds.Contains(Id)).Select(x => x.UserId);
|
||||||
/// <summary> Returns a list of all members in this role. </summary>
|
/// <summary> Returns a list of all members in this role. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Member> Members => IsEveryone ? Server.Members : Server.Members.Where(x => x.RoleIds.Contains(Id));
|
public IEnumerable<Member> Members => IsEveryone ? Server.Members : Server.Members.Where(x => x.RoleIds.Contains(Id));
|
||||||
|
|
||||||
internal Role(DiscordClient client, string id, string serverId, bool isEveryone)
|
internal Role(DiscordClient client, string id, string serverId, bool isEveryone)
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace Discord
|
|||||||
/// <summary> Return the id of the role representing all users in a server. </summary>
|
/// <summary> Return the id of the role representing all users in a server. </summary>
|
||||||
public string EveryoneRoleId { get; private set; }
|
public string EveryoneRoleId { get; private set; }
|
||||||
/// <summary> Return the the role representing all users in a server. </summary>
|
/// <summary> Return the the role representing all users in a server. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public Role EveryoneRole => _client.Roles[EveryoneRoleId];
|
public Role EveryoneRole => _client.Roles[EveryoneRoleId];
|
||||||
/// <summary> Returns a collection of the ids of all roles within this server. </summary>
|
/// <summary> Returns a collection of the ids of all roles within this server. </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|||||||
@@ -42,12 +42,16 @@ namespace Discord
|
|||||||
public Channel PrivateChannel => _client.Channels[PrivateChannelId];
|
public Channel PrivateChannel => _client.Channels[PrivateChannelId];
|
||||||
|
|
||||||
/// <summary> Returns a collection of all server-specific data for every server this user is a member of. </summary>
|
/// <summary> Returns a collection of all server-specific data for every server this user is a member of. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Member> Memberships => _servers.Select(x => _client.GetMember(x.Key, Id));
|
public IEnumerable<Member> Memberships => _servers.Select(x => _client.GetMember(x.Key, Id));
|
||||||
/// <summary> Returns a collection of all servers this user is a member of. </summary>
|
/// <summary> Returns a collection of all servers this user is a member of. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Server> Servers => _servers.Select(x => _client.GetServer(x.Key));
|
public IEnumerable<Server> Servers => _servers.Select(x => _client.GetServer(x.Key));
|
||||||
/// <summary> Returns a collection of the ids of all servers this user is a member of. </summary>
|
/// <summary> Returns a collection of the ids of all servers this user is a member of. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<string> ServersIds => _servers.Select(x => x.Key);
|
public IEnumerable<string> ServersIds => _servers.Select(x => x.Key);
|
||||||
/// <summary> Returns a collection of all messages this user has sent that are still in cache. </summary>
|
/// <summary> Returns a collection of all messages this user has sent that are still in cache. </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public IEnumerable<Message> Messages => _client.Messages.Where(x => x.UserId == Id);
|
public IEnumerable<Message> Messages => _client.Messages.Where(x => x.UserId == Id);
|
||||||
|
|
||||||
/// <summary> Returns the id for the game this user is currently playing. </summary>
|
/// <summary> Returns the id for the game this user is currently playing. </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user