Browse Source

implement additional model properties in IGuild types

pull/1319/head
Chris Johnston 6 years ago
parent
commit
cbe06cacac
3 changed files with 63 additions and 0 deletions
  1. +35
    -0
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  2. +14
    -0
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  3. +14
    -0
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 35
- 0
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -196,6 +196,41 @@ namespace Discord
/// A read-only collection of roles found within this guild.
/// </returns>
IReadOnlyCollection<IRole> Roles { get; }
/// <summary>
/// Gets the tier of guild boosting in this guild.
/// </summary>
/// <returns>
/// The tier of guild boosting in this guild.
/// </returns>
PremiumTier PremiumTier { get; }
/// <summary>
/// Gets the identifier for this guilds vanity image.
/// </summary>
/// <remarks>
/// An identifier for the vanity image; <c>null</c> if none is set.
/// </remarks>
string VanityId { get; }
/// <summary>
/// Gets the URL of this guild's vanity image.
/// </summary>
/// <returns>
/// A URL pointing to the guild's vanity image; <c>null</c> if none is set.
/// </returns>
string VanityUrl { get; }
/// <summary>
/// Gets the flags for the types of system channels that are disabled.
/// </summary>
/// <returns>
/// The flags for the types of system channel flags that are disabled.
/// </returns>
SystemChannelMessageDeny SystemChannelFlags { get; }
/// <summary>
/// Gets the description for the guild.
/// </summary>
/// <returns>
/// The description for the guild; <c>null</c> if none is set.
/// </returns>
string Description { get; }

/// <summary>
/// Modifies this guild.


+ 14
- 0
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -52,6 +52,14 @@ namespace Discord.Rest
internal bool Available { get; private set; }
/// <inheritdoc />
public ulong? ApplicationId { get; private set; }
/// <inheritdoc />
public PremiumTier PremiumTier { get; private set; }
/// <inheritdoc />
public string VanityId { get; private set; }
/// <inheritdoc />
public SystemChannelMessageDeny SystemChannelFlags { get; private set; }
/// <inheritdoc />
public string Description { get; private set; }

/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
@@ -62,6 +70,8 @@ namespace Discord.Rest
public string IconUrl => CDN.GetGuildIconUrl(Id, IconId);
/// <inheritdoc />
public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId);
/// <inheritdoc />
public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId);

/// <summary>
/// Gets the built-in role containing all users in this guild.
@@ -104,6 +114,10 @@ namespace Discord.Rest
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;
ApplicationId = model.ApplicationId;
PremiumTier = model.PremiumTier;
VanityId = model.VanityURLCode;
SystemChannelFlags = model.SystemChannelFlags;
Description = model.Description;

if (model.Emojis != null)
{


+ 14
- 0
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -93,6 +93,14 @@ namespace Discord.WebSocket
public string IconId { get; private set; }
/// <inheritdoc />
public string SplashId { get; private set; }
/// <inheritdoc />
public PremiumTier PremiumTier { get; private set; }
/// <inheritdoc />
public string VanityId { get; private set; }
/// <inheritdoc />
public SystemChannelMessageDeny SystemChannelFlags { get; private set; }
/// <inheritdoc />
public string Description { get; private set; }

/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
@@ -100,6 +108,8 @@ namespace Discord.WebSocket
public string IconUrl => CDN.GetGuildIconUrl(Id, IconId);
/// <inheritdoc />
public string SplashUrl => CDN.GetGuildSplashUrl(Id, SplashId);
/// <inheritdoc />
public string VanityUrl => CDN.GetGuildVanityUrl(Id, VanityId);
/// <summary> Indicates whether the client has all the members downloaded to the local guild cache. </summary>
public bool HasAllMembers => MemberCount == DownloadedMemberCount;// _downloaderPromise.Task.IsCompleted;
/// <summary> Indicates whether the guild cache is synced to this guild. </summary>
@@ -354,6 +364,10 @@ namespace Discord.WebSocket
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;
ApplicationId = model.ApplicationId;
PremiumTier = model.PremiumTier;
VanityId = model.VanityURLCode;
SystemChannelFlags = model.SystemChannelFlags;
Description = model.Description;

if (model.Emojis != null)
{


Loading…
Cancel
Save