[Feature] New discord features (#2649)
This commit is contained in:
@@ -11,6 +11,8 @@ namespace Discord;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public enum ApplicationFlags
|
public enum ApplicationFlags
|
||||||
{
|
{
|
||||||
|
UsesAutoModApi = 1 << 6,
|
||||||
|
|
||||||
GatewayPresence = 1 << 12,
|
GatewayPresence = 1 << 12,
|
||||||
|
|
||||||
GatewayPresenceLimited = 1 << 13,
|
GatewayPresenceLimited = 1 << 13,
|
||||||
|
|||||||
@@ -13,185 +13,260 @@ namespace Discord
|
|||||||
/// The guild has no features.
|
/// The guild has no features.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None = 0L,
|
None = 0L,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to animated banners.
|
/// The guild has access to animated banners.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AnimatedBanner = 1L << 0,
|
AnimatedBanner = 1L << 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to set an animated guild icon.
|
/// The guild has access to set an animated guild icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AnimatedIcon = 1L << 1,
|
AnimatedIcon = 1L << 1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to set a guild banner image.
|
/// The guild has access to set a guild banner image.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Banner = 1L << 2,
|
Banner = 1L << 2,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to channel banners.
|
/// The guild has access to channel banners.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ChannelBanner = 1L << 3,
|
ChannelBanner = 1L << 3,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to use commerce features (i.e. create store channels).
|
/// The guild has access to use commerce features (i.e. create store channels).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Commerce = 1L << 4,
|
Commerce = 1L << 4,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates. This feature is mutable.
|
/// The guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This feature is mutable.
|
||||||
|
/// </remarks>
|
||||||
Community = 1L << 5,
|
Community = 1L << 5,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is able to be discovered in the directory. This feature is mutable.
|
/// The guild is able to be discovered in the directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This feature is mutable.
|
||||||
|
/// </remarks>
|
||||||
Discoverable = 1L << 6,
|
Discoverable = 1L << 6,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has discoverable disabled.
|
/// The guild has discoverable disabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DiscoverableDisabled = 1L << 7,
|
DiscoverableDisabled = 1L << 7,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has enabled discoverable before.
|
/// The guild has enabled discoverable before.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
EnabledDiscoverableBefore = 1L << 8,
|
EnabledDiscoverableBefore = 1L << 8,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is able to be featured in the directory.
|
/// The guild is able to be featured in the directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Featureable = 1L << 9,
|
Featureable = 1L << 9,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has a force relay.
|
/// The guild has a force relay.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ForceRelay = 1L << 10,
|
ForceRelay = 1L << 10,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has a directory entry.
|
/// The guild has a directory entry.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HasDirectoryEntry = 1L << 11,
|
HasDirectoryEntry = 1L << 11,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is a hub.
|
/// The guild is a hub.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Hub = 1L << 12,
|
Hub = 1L << 12,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// You shouldn't be here...
|
/// You shouldn't be here...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
InternalEmployeeOnly = 1L << 13,
|
InternalEmployeeOnly = 1L << 13,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to set an invite splash background.
|
/// The guild has access to set an invite splash background.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
InviteSplash = 1L << 14,
|
InviteSplash = 1L << 14,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is linked to a hub.
|
/// The guild is linked to a hub.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LinkedToHub = 1L << 15,
|
LinkedToHub = 1L << 15,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has member profiles.
|
/// The guild has member profiles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MemberProfiles = 1L << 16,
|
MemberProfiles = 1L << 16,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has enabled <seealso href="https://discord.com/developers/docs/resources/guild#membership-screening-object">Membership Screening</seealso>.
|
/// The guild has enabled <seealso href="https://discord.com/developers/docs/resources/guild#membership-screening-object">Membership Screening</seealso>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MemberVerificationGateEnabled = 1L << 17,
|
MemberVerificationGateEnabled = 1L << 17,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has enabled monetization.
|
/// The guild has enabled monetization.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MonetizationEnabled = 1L << 18,
|
MonetizationEnabled = 1L << 18,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has more emojis.
|
/// The guild has more emojis.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MoreEmoji = 1L << 19,
|
MoreEmoji = 1L << 19,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has increased custom sticker slots.
|
/// The guild has increased custom sticker slots.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MoreStickers = 1L << 20,
|
MoreStickers = 1L << 20,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to create news channels.
|
/// The guild has access to create news channels.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
News = 1L << 21,
|
News = 1L << 21,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has new thread permissions.
|
/// The guild has new thread permissions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
NewThreadPermissions = 1L << 22,
|
NewThreadPermissions = 1L << 22,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is partnered.
|
/// The guild is partnered.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Partnered = 1L << 23,
|
Partnered = 1L << 23,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has a premium tier three override; guilds made by Discord usually have this.
|
/// The guild has a premium tier three override; guilds made by Discord usually have this.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PremiumTier3Override = 1L << 24,
|
PremiumTier3Override = 1L << 24,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild can be previewed before joining via Membership Screening or the directory.
|
/// The guild can be previewed before joining via Membership Screening or the directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PreviewEnabled = 1L << 25,
|
PreviewEnabled = 1L << 25,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to create private threads.
|
/// The guild has access to create private threads.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PrivateThreads = 1L << 26,
|
PrivateThreads = 1L << 26,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has relay enabled.
|
/// The guild has relay enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RelayEnabled = 1L << 27,
|
RelayEnabled = 1L << 27,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is able to set role icons.
|
/// The guild is able to set role icons.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RoleIcons = 1L << 28,
|
RoleIcons = 1L << 28,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has role subscriptions available for purchase.
|
/// The guild has role subscriptions available for purchase.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RoleSubscriptionsAvailableForPurchase = 1L << 29,
|
RoleSubscriptionsAvailableForPurchase = 1L << 29,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has role subscriptions enabled.
|
/// The guild has role subscriptions enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RoleSubscriptionsEnabled = 1L << 30,
|
RoleSubscriptionsEnabled = 1L << 30,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to the seven day archive time for threads.
|
/// The guild has access to the seven day archive time for threads.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SevenDayThreadArchive = 1L << 31,
|
SevenDayThreadArchive = 1L << 31,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has text in voice enabled.
|
/// The guild has text in voice enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TextInVoiceEnabled = 1L << 32,
|
TextInVoiceEnabled = 1L << 32,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has threads enabled.
|
/// The guild has threads enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ThreadsEnabled = 1L << 33,
|
ThreadsEnabled = 1L << 33,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has testing threads enabled.
|
/// The guild has testing threads enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ThreadsEnabledTesting = 1L << 34,
|
ThreadsEnabledTesting = 1L << 34,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has the default thread auto archive.
|
/// The guild has the default thread auto archive.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ThreadsDefaultAutoArchiveDuration = 1L << 35,
|
ThreadsDefaultAutoArchiveDuration = 1L << 35,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to the three day archive time for threads.
|
/// The guild has access to the three day archive time for threads.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ThreeDayThreadArchive = 1L << 36,
|
ThreeDayThreadArchive = 1L << 36,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has enabled ticketed events.
|
/// The guild has enabled ticketed events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TicketedEventsEnabled = 1L << 37,
|
TicketedEventsEnabled = 1L << 37,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to set a vanity URL.
|
/// The guild has access to set a vanity URL.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
VanityUrl = 1L << 38,
|
VanityUrl = 1L << 38,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild is verified.
|
/// The guild is verified.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Verified = 1L << 39,
|
Verified = 1L << 39,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has access to set 384kbps bitrate in voice (previously VIP voice servers).
|
/// The guild has access to set 384kbps bitrate in voice (previously VIP voice servers).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
VIPRegions = 1L << 40,
|
VIPRegions = 1L << 40,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has enabled the welcome screen.
|
/// The guild has enabled the welcome screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
WelcomeScreenEnabled = 1L << 41,
|
WelcomeScreenEnabled = 1L << 41,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has been set as a support server on the App Directory.
|
/// The guild has been set as a support server on the App Directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DeveloperSupportServer = 1L << 42,
|
DeveloperSupportServer = 1L << 42,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has invites disabled. This feature is mutable.
|
/// The guild has invites disabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This feature is mutable.
|
||||||
|
/// </remarks>
|
||||||
InvitesDisabled = 1L << 43,
|
InvitesDisabled = 1L << 43,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The guild has auto moderation enabled.
|
/// The guild has auto moderation enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
AutoModeration = 1L << 44
|
AutoModeration = 1L << 44,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This guild has alerts for join raids disabled.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This feature is mutable.
|
||||||
|
/// </remarks>
|
||||||
|
RaidAlertsDisabled = 1L << 45,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This guild has Clyde AI enabled.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This feature is mutable.
|
||||||
|
/// </remarks>
|
||||||
|
ClydeEnabled = 1L << 46,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This guild has a guild web page vanity url.
|
||||||
|
/// </summary>
|
||||||
|
GuildWebPageVanityUrl = 1L << 47
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,5 +118,10 @@ namespace Discord
|
|||||||
/// Gets or sets the guild features enabled in this guild. Features that are not mutable will be ignored.
|
/// Gets or sets the guild features enabled in this guild. Features that are not mutable will be ignored.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Optional<GuildFeature> Features { get; set; }
|
public Optional<GuildFeature> Features { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ID of the safety alerts channel.
|
||||||
|
/// </summary>
|
||||||
|
public Optional<ulong> SafetyAlertsChannelId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,14 @@ namespace Discord
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
ulong? WidgetChannelId { get; }
|
ulong? WidgetChannelId { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Gets the ID of the channel assigned to the safety alerts channel of this guild.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// A <see langword="ulong"/> representing the snowflake identifier of the safety alerts channel;
|
||||||
|
/// <see langword="null" /> if none is set.
|
||||||
|
/// </returns>
|
||||||
|
ulong? SafetyAlertsChannelId { get; }
|
||||||
|
/// <summary>
|
||||||
/// Gets the ID of the channel where randomized welcome messages are sent.
|
/// Gets the ID of the channel where randomized welcome messages are sent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
|
|||||||
@@ -26,5 +26,21 @@ namespace Discord
|
|||||||
/// A flags enum containing all the features for the guild.
|
/// A flags enum containing all the features for the guild.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
GuildFeatures Features { get; }
|
GuildFeatures Features { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the approximate number of members in this guild.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Only available when getting a guild via REST when `with_counts` is true.
|
||||||
|
/// </remarks>
|
||||||
|
int? ApproximateMemberCount { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the approximate number of non-offline members in this guild.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Only available when getting a guild via REST when `with_counts` is true.
|
||||||
|
/// </remarks>
|
||||||
|
int? ApproximatePresenceCount { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ namespace Discord.API
|
|||||||
public Optional<bool> WidgetEnabled { get; set; }
|
public Optional<bool> WidgetEnabled { get; set; }
|
||||||
[JsonProperty("widget_channel_id")]
|
[JsonProperty("widget_channel_id")]
|
||||||
public Optional<ulong?> WidgetChannelId { get; set; }
|
public Optional<ulong?> WidgetChannelId { get; set; }
|
||||||
|
[JsonProperty("safety_alerts_channel_id")]
|
||||||
|
public Optional<ulong?> SafetyAlertsChannelId { get; set; }
|
||||||
[JsonProperty("system_channel_id")]
|
[JsonProperty("system_channel_id")]
|
||||||
public ulong? SystemChannelId { get; set; }
|
public ulong? SystemChannelId { get; set; }
|
||||||
[JsonProperty("premium_tier")]
|
[JsonProperty("premium_tier")]
|
||||||
|
|||||||
@@ -16,5 +16,11 @@ namespace Discord.API
|
|||||||
public string Permissions { get; set; }
|
public string Permissions { get; set; }
|
||||||
[JsonProperty("features")]
|
[JsonProperty("features")]
|
||||||
public GuildFeatures Features { get; set; }
|
public GuildFeatures Features { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("approximate_member_count")]
|
||||||
|
public Optional<int> ApproximateMemberCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("approximate_presence_count")]
|
||||||
|
public Optional<int> ApproximatePresenceCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ namespace Discord.API.Rest
|
|||||||
public Optional<Image?> Splash { get; set; }
|
public Optional<Image?> Splash { get; set; }
|
||||||
[JsonProperty("afk_channel_id")]
|
[JsonProperty("afk_channel_id")]
|
||||||
public Optional<ulong?> AfkChannelId { get; set; }
|
public Optional<ulong?> AfkChannelId { get; set; }
|
||||||
|
[JsonProperty("safety_alerts_channel_id")]
|
||||||
|
public Optional<ulong> SafetyAlertsChannelId { get; set; }
|
||||||
[JsonProperty("owner_id")]
|
[JsonProperty("owner_id")]
|
||||||
public Optional<ulong> OwnerId { get; set; }
|
public Optional<ulong> OwnerId { get; set; }
|
||||||
[JsonProperty("explicit_content_filter")]
|
[JsonProperty("explicit_content_filter")]
|
||||||
|
|||||||
@@ -2245,7 +2245,7 @@ namespace Discord.API
|
|||||||
int limit = args.Limit.GetValueOrDefault(int.MaxValue);
|
int limit = args.Limit.GetValueOrDefault(int.MaxValue);
|
||||||
ulong afterGuildId = args.AfterGuildId.GetValueOrDefault(0);
|
ulong afterGuildId = args.AfterGuildId.GetValueOrDefault(0);
|
||||||
|
|
||||||
return await SendAsync<IReadOnlyCollection<UserGuild>>("GET", () => $"users/@me/guilds?limit={limit}&after={afterGuildId}", new BucketIds(), options: options).ConfigureAwait(false);
|
return await SendAsync<IReadOnlyCollection<UserGuild>>("GET", () => $"users/@me/guilds?limit={limit}&after={afterGuildId}&with_counts=true", new BucketIds(), options: options).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
public async Task<Application> GetMyApplicationAsync(RequestOptions options = null)
|
public async Task<Application> GetMyApplicationAsync(RequestOptions options = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ulong? WidgetChannelId { get; private set; }
|
public ulong? WidgetChannelId { get; private set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
public ulong? SafetyAlertsChannelId { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
public ulong? SystemChannelId { get; private set; }
|
public ulong? SystemChannelId { get; private set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ulong? RulesChannelId { get; private set; }
|
public ulong? RulesChannelId { get; private set; }
|
||||||
@@ -151,6 +153,8 @@ namespace Discord.Rest
|
|||||||
AFKChannelId = model.AFKChannelId;
|
AFKChannelId = model.AFKChannelId;
|
||||||
if (model.WidgetChannelId.IsSpecified)
|
if (model.WidgetChannelId.IsSpecified)
|
||||||
WidgetChannelId = model.WidgetChannelId.Value;
|
WidgetChannelId = model.WidgetChannelId.Value;
|
||||||
|
if (model.SafetyAlertsChannelId.IsSpecified)
|
||||||
|
SafetyAlertsChannelId = model.SafetyAlertsChannelId.Value;
|
||||||
SystemChannelId = model.SystemChannelId;
|
SystemChannelId = model.SystemChannelId;
|
||||||
RulesChannelId = model.RulesChannelId;
|
RulesChannelId = model.RulesChannelId;
|
||||||
PublicUpdatesChannelId = model.PublicUpdatesChannelId;
|
PublicUpdatesChannelId = model.PublicUpdatesChannelId;
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public GuildFeatures Features { get; private set; }
|
public GuildFeatures Features { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public int? ApproximateMemberCount { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public int? ApproximatePresenceCount { get; private set; }
|
||||||
|
|
||||||
internal RestUserGuild(BaseDiscordClient discord, ulong id)
|
internal RestUserGuild(BaseDiscordClient discord, ulong id)
|
||||||
: base(discord, id)
|
: base(discord, id)
|
||||||
{
|
{
|
||||||
@@ -42,6 +48,8 @@ namespace Discord.Rest
|
|||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
Permissions = new GuildPermissions(model.Permissions);
|
Permissions = new GuildPermissions(model.Permissions);
|
||||||
Features = model.Features;
|
Features = model.Features;
|
||||||
|
ApproximateMemberCount = model.ApproximateMemberCount.IsSpecified ? model.ApproximateMemberCount.Value : null;
|
||||||
|
ApproximatePresenceCount = model.ApproximatePresenceCount.IsSpecified ? model.ApproximatePresenceCount.Value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task LeaveAsync(RequestOptions options = null)
|
public async Task LeaveAsync(RequestOptions options = null)
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ namespace Discord.WebSocket
|
|||||||
|
|
||||||
internal ulong? AFKChannelId { get; private set; }
|
internal ulong? AFKChannelId { get; private set; }
|
||||||
internal ulong? WidgetChannelId { get; private set; }
|
internal ulong? WidgetChannelId { get; private set; }
|
||||||
|
internal ulong? SafetyAlertsChannelId { get; private set; }
|
||||||
internal ulong? SystemChannelId { get; private set; }
|
internal ulong? SystemChannelId { get; private set; }
|
||||||
internal ulong? RulesChannelId { get; private set; }
|
internal ulong? RulesChannelId { get; private set; }
|
||||||
internal ulong? PublicUpdatesChannelId { get; private set; }
|
internal ulong? PublicUpdatesChannelId { get; private set; }
|
||||||
@@ -220,6 +221,22 @@ namespace Discord.WebSocket
|
|||||||
return id.HasValue ? GetChannel(id.Value) : null;
|
return id.HasValue ? GetChannel(id.Value) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the safety alerts channel in this guild.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// The channel set for receiving safety alerts channel; <see langword="null"/> if none is set.
|
||||||
|
/// </returns>
|
||||||
|
public SocketGuildChannel SafetyAlertsChannel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var id = SafetyAlertsChannelId;
|
||||||
|
return id.HasValue ? GetChannel(id.Value) : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the system channel where randomized welcome messages are sent in this guild.
|
/// Gets the system channel where randomized welcome messages are sent in this guild.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -498,6 +515,8 @@ namespace Discord.WebSocket
|
|||||||
AFKChannelId = model.AFKChannelId;
|
AFKChannelId = model.AFKChannelId;
|
||||||
if (model.WidgetChannelId.IsSpecified)
|
if (model.WidgetChannelId.IsSpecified)
|
||||||
WidgetChannelId = model.WidgetChannelId.Value;
|
WidgetChannelId = model.WidgetChannelId.Value;
|
||||||
|
if (model.SafetyAlertsChannelId.IsSpecified)
|
||||||
|
SafetyAlertsChannelId = model.SafetyAlertsChannelId.Value;
|
||||||
SystemChannelId = model.SystemChannelId;
|
SystemChannelId = model.SystemChannelId;
|
||||||
RulesChannelId = model.RulesChannelId;
|
RulesChannelId = model.RulesChannelId;
|
||||||
PublicUpdatesChannelId = model.PublicUpdatesChannelId;
|
PublicUpdatesChannelId = model.PublicUpdatesChannelId;
|
||||||
@@ -1894,6 +1913,8 @@ namespace Discord.WebSocket
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
ulong? IGuild.WidgetChannelId => WidgetChannelId;
|
ulong? IGuild.WidgetChannelId => WidgetChannelId;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
ulong? IGuild.SafetyAlertsChannelId => SafetyAlertsChannelId;
|
||||||
|
/// <inheritdoc />
|
||||||
ulong? IGuild.SystemChannelId => SystemChannelId;
|
ulong? IGuild.SystemChannelId => SystemChannelId;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
ulong? IGuild.RulesChannelId => RulesChannelId;
|
ulong? IGuild.RulesChannelId => RulesChannelId;
|
||||||
|
|||||||
Reference in New Issue
Block a user