Skip to content

Commit d30e9b5

Browse files
authored
add permissions (#590)
1 parent 752ea45 commit d30e9b5

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

lib/src/models/permissions.dart

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Permissions extends Flags<Permissions> {
9595
/// Allows management and editing of webhooks.
9696
static const manageWebhooks = Flag<Permissions>.fromOffset(29);
9797

98-
/// Allows management and editing of emojis, stickers, and soundboard sounds.
98+
/// Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users.
9999
static const manageEmojisAndStickers = Flag<Permissions>.fromOffset(30);
100100

101101
/// Allows members to use application commands, including slash commands and context menu commands..
@@ -104,7 +104,7 @@ class Permissions extends Flags<Permissions> {
104104
/// Allows for requesting to speak in stage channels. (This permission is under active development and may be changed or removed.).
105105
static const requestToSpeak = Flag<Permissions>.fromOffset(32);
106106

107-
/// Allows for creating, editing, and deleting scheduled events.
107+
/// Allows for editing and deleting scheduled events created by all users.
108108
static const manageEvents = Flag<Permissions>.fromOffset(33);
109109

110110
/// Allows for deleting and archiving threads, and viewing all private threads.
@@ -134,8 +134,20 @@ class Permissions extends Flags<Permissions> {
134134
/// Allows for using soundboard in a voice channel.
135135
static const useSoundboard = Flag<Permissions>.fromOffset(42);
136136

137+
/// Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user.
138+
static const createEmojiAndStickers = Flag<Permissions>.fromOffset(43);
139+
140+
/// Allows for creating scheduled events, and editing and deleting those created by the current user.
141+
static const createEvents = Flag<Permissions>.fromOffset(44);
142+
143+
/// Allows the usage of custom soundboard sounds from other servers.
144+
static const useExternalSounds = Flag<Permissions>.fromOffset(45);
145+
146+
/// Allows sending voice messages.
147+
static const sendVoiceMessages = Flag<Permissions>.fromOffset(46);
148+
137149
/// A [Permissions] with all permissions enabled.
138-
static const allPermissions = Permissions(1099511627775);
150+
static const allPermissions = Permissions(140737488355327);
139151

140152
/// Whether this set of permissions has the [createInstantInvite] permission.
141153
bool get canCreateInstantInvite => has(createInstantInvite);
@@ -266,6 +278,18 @@ class Permissions extends Flags<Permissions> {
266278
/// Whether this set of permissions has the [useSoundboard] permission.
267279
bool get canUseSoundboard => has(useSoundboard);
268280

281+
/// Whether this set of permissions has the [createEmojiAndStickers] permission.
282+
bool get canCreateEmojiAndStickers => has(createEmojiAndStickers);
283+
284+
/// Whether this set of permissions has the [createEvents] permission.
285+
bool get canCreateEvents => has(createEvents);
286+
287+
/// Whether this set of permissions has the [useExternalSounds] permission.
288+
bool get canUseExternalSounds => has(useExternalSounds);
289+
290+
/// Whether this set of permissions has the [sendVoiceMessages] permission.
291+
bool get canSendVoiceMessages => has(sendVoiceMessages);
292+
269293
/// Create a new [Permissions] from a permissions value.
270294
const Permissions(super.value);
271295
}

0 commit comments

Comments
 (0)