Skip to content

Commit

Permalink
Add Permission.CreateGuildExpressions and Permission.CreateEvents (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann authored Nov 22, 2023
1 parent b6e878a commit f68ce8c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
8 changes: 8 additions & 0 deletions common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -7897,6 +7897,14 @@ public final class dev/kord/common/entity/Permission$Connect : dev/kord/common/e
public static final field INSTANCE Ldev/kord/common/entity/Permission$Connect;
}

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

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

public final class dev/kord/common/entity/Permission$CreateInstantInvite : dev/kord/common/entity/Permission {
public static final field INSTANCE Ldev/kord/common/entity/Permission$CreateInstantInvite;
}
Expand Down
23 changes: 19 additions & 4 deletions common/src/commonMain/kotlin/entity/Permission.kt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public sealed class Permission {
public object ManageWebhooks : Permission(29)

/**
* Allows management and editing of emojis, stickers, and soundboard sounds.
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users.
*/
public object ManageGuildExpressions : Permission(30)

Expand All @@ -292,7 +292,7 @@ public sealed class Permission {
public object RequestToSpeak : Permission(32)

/**
* Allows for creating, editing, and deleting scheduled events.
* Allows for editing and deleting scheduled events created by all users.
*/
public object ManageEvents : Permission(33)

Expand Down Expand Up @@ -343,6 +343,18 @@ public sealed class Permission {
*/
public object UseSoundboard : Permission(42)

/**
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those
* created by the current user.
*/
public object CreateGuildExpressions : Permission(43)

/**
* Allows for creating scheduled events, and editing and deleting those created by the current
* user.
*/
public object CreateEvents : Permission(44)

/**
* Allows the usage of custom soundboard sounds from other servers.
*/
Expand Down Expand Up @@ -411,6 +423,8 @@ public sealed class Permission {
ModerateMembers,
ViewCreatorMonetizationAnalytics,
UseSoundboard,
CreateGuildExpressions,
CreateEvents,
UseExternalSounds,
SendVoiceMessages,
)
Expand Down Expand Up @@ -475,6 +489,8 @@ public sealed class Permission {
40 -> ModerateMembers
41 -> ViewCreatorMonetizationAnalytics
42 -> UseSoundboard
43 -> CreateGuildExpressions
44 -> CreateEvents
45 -> UseExternalSounds
46 -> SendVoiceMessages
else -> Unknown(shift)
Expand Down Expand Up @@ -528,8 +544,7 @@ public sealed class Permission {
* specific [Permission]s:
* ```kotlin
* val hasPermission = Permission.CreateInstantInvite in permissions
* val hasPermissions = Permissions(Permission.CreateInstantInvite,
* Permission.KickMembers) in permissions
* val hasPermissions = Permissions(Permission.CreateInstantInvite, Permission.KickMembers) in permissions
* ```
*
* ## Unknown [Permission]s
Expand Down
16 changes: 14 additions & 2 deletions common/src/commonMain/kotlin/entity/Permissions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
Entry("ManageWebhooks", shift = 29, kDoc = "Allows management and editing of webhooks."),
Entry(
"ManageGuildExpressions", shift = 30,
kDoc = "Allows management and editing of emojis, stickers, and soundboard sounds.",
kDoc = "Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users.",
),
Entry(
"UseApplicationCommands", shift = 31,
Expand All @@ -58,7 +58,10 @@
kDoc = "Allows for requesting to speak in stage channels.\n\n" +
"_This permission is under active development and may be changed or removed._",
),
Entry("ManageEvents", shift = 33, kDoc = "Allows for creating, editing, and deleting scheduled events."),
Entry(
"ManageEvents", shift = 33,
kDoc = "Allows for editing and deleting scheduled events created by all users.",
),
Entry(
"ManageThreads", shift = 34,
kDoc = "Allows for deleting and archiving threads, and viewing all private threads.",
Expand All @@ -79,6 +82,15 @@
),
Entry("ViewCreatorMonetizationAnalytics", shift = 41, kDoc = "Allows for viewing role subscription insights."),
Entry("UseSoundboard", shift = 42, kDoc = "Allows for using soundboard in a voice channel."),
Entry(
"CreateGuildExpressions", shift = 43,
kDoc = "Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those " +
"created by the current user."
),
Entry(
"CreateEvents", shift = 44,
kDoc = "Allows for creating scheduled events, and editing and deleting those created by the current user.",
),
Entry(
"UseExternalSounds", shift = 45,
kDoc = "Allows the usage of custom soundboard sounds from other servers."
Expand Down

0 comments on commit f68ce8c

Please sign in to comment.