Skip to content

Commit

Permalink
Add new GuildFeatures
Browse files Browse the repository at this point in the history
 * InvitesDisabled:
   discord/discord-api-docs#5269

 * DeveloperSupportServer:
   discord/discord-api-docs#5572

 * ApplicationCommandPermissionsV2:
   discord/discord-api-docs#5649
  • Loading branch information
lukellmann committed Nov 18, 2022
1 parent b8ca7bc commit 2bd7d5a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -6212,6 +6212,10 @@ public final class dev/kord/common/entity/GuildFeature$AnimatedIcon : dev/kord/c
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$AnimatedIcon;
}

public final class dev/kord/common/entity/GuildFeature$ApplicationCommandPermissionsV2 : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$ApplicationCommandPermissionsV2;
}

public final class dev/kord/common/entity/GuildFeature$AutoModeration : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$AutoModeration;
}
Expand All @@ -6233,6 +6237,10 @@ public final class dev/kord/common/entity/GuildFeature$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class dev/kord/common/entity/GuildFeature$DeveloperSupportServer : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$DeveloperSupportServer;
}

public final class dev/kord/common/entity/GuildFeature$Discoverable : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$Discoverable;
}
Expand All @@ -6245,6 +6253,10 @@ public final class dev/kord/common/entity/GuildFeature$InviteSplash : dev/kord/c
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$InviteSplash;
}

public final class dev/kord/common/entity/GuildFeature$InvitesDisabled : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$InvitesDisabled;
}

public final class dev/kord/common/entity/GuildFeature$MemberVerificationGateEnabled : dev/kord/common/entity/GuildFeature {
public static final field INSTANCE Ldev/kord/common/entity/GuildFeature$MemberVerificationGateEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public sealed class GuildFeature(
*/
public object AnimatedIcon : GuildFeature("ANIMATED_ICON")

/**
* Guild is using the old permissions configuration behavior.
*/
public object ApplicationCommandPermissionsV2 :
GuildFeature("APPLICATION_COMMAND_PERMISSIONS_V2")

/**
* Guild has set up auto moderation rules.
*/
Expand All @@ -75,6 +81,11 @@ public sealed class GuildFeature(
*/
public object Community : GuildFeature("COMMUNITY")

/**
* Guild has been set as a support server on the App Directory.
*/
public object DeveloperSupportServer : GuildFeature("DEVELOPER_SUPPORT_SERVER")

/**
* Guild is able to be discovered in the directory.
*/
Expand All @@ -85,6 +96,11 @@ public sealed class GuildFeature(
*/
public object Featurable : GuildFeature("FEATURABLE")

/**
* Guild has paused invites, preventing new users from joining.
*/
public object InvitesDisabled : GuildFeature("INVITES_DISABLED")

/**
* Guild has access to set an invite splash background.
*/
Expand Down Expand Up @@ -201,12 +217,15 @@ public sealed class GuildFeature(
when (val value = decoder.decodeString()) {
"ANIMATED_BANNER" -> AnimatedBanner
"ANIMATED_ICON" -> AnimatedIcon
"APPLICATION_COMMAND_PERMISSIONS_V2" -> ApplicationCommandPermissionsV2
"AUTO_MODERATION" -> AutoModeration
"BANNER" -> Banner
"COMMERCE" -> @Suppress("DEPRECATION_ERROR") Commerce
"COMMUNITY" -> Community
"DEVELOPER_SUPPORT_SERVER" -> DeveloperSupportServer
"DISCOVERABLE" -> Discoverable
"FEATURABLE" -> Featurable
"INVITES_DISABLED" -> InvitesDisabled
"INVITE_SPLASH" -> InviteSplash
"MEMBER_VERIFICATION_GATE_ENABLED" -> MemberVerificationGateEnabled
"MONETIZATION_ENABLED" -> MonetizationEnabled
Expand Down Expand Up @@ -235,12 +254,15 @@ public sealed class GuildFeature(
listOf(
AnimatedBanner,
AnimatedIcon,
ApplicationCommandPermissionsV2,
AutoModeration,
Banner,
@Suppress("DEPRECATION_ERROR") Commerce,
Community,
DeveloperSupportServer,
Discoverable,
Featurable,
InvitesDisabled,
InviteSplash,
MemberVerificationGateEnabled,
MonetizationEnabled,
Expand Down
12 changes: 12 additions & 0 deletions common/src/main/kotlin/entity/DiscordGuild.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,30 @@
kDoc = "Guild has access to set an animated guild banner image.",
),
Entry("AnimatedIcon", stringValue = "ANIMATED_ICON", kDoc = "Guild has access to set an animated guild icon."),
Entry(
"ApplicationCommandPermissionsV2", stringValue = "APPLICATION_COMMAND_PERMISSIONS_V2",
kDoc = "Guild is using the old permissions configuration behavior.",
),
Entry("AutoModeration", stringValue = "AUTO_MODERATION", kDoc = "Guild has set up auto moderation rules."),
Entry("Banner", stringValue = "BANNER", kDoc = "Guild has access to set a guild banner image."),
Entry(
"Community", stringValue = "COMMUNITY",
kDoc = "Guild can enable welcome screen, Membership Screening, stage channels and discovery, and " +
"receives community updates.",
),
Entry(
"DeveloperSupportServer", stringValue = "DEVELOPER_SUPPORT_SERVER",
kDoc = "Guild has been set as a support server on the App Directory.",
),
Entry("Discoverable", stringValue = "DISCOVERABLE", kDoc = "Guild is able to be discovered in the directory."),
Entry(
"Featurable", stringValue = "FEATURABLE",
kDoc = "Guild is able to be featured in the directory.",
),
Entry(
"InvitesDisabled", stringValue = "INVITES_DISABLED",
kDoc = "Guild has paused invites, preventing new users from joining.",
),
Entry(
"InviteSplash", stringValue = "INVITE_SPLASH",
kDoc = "Guild has access to set an invite splash background.",
Expand Down

0 comments on commit 2bd7d5a

Please sign in to comment.