Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KubaZ2 committed Apr 1, 2023
1 parent 0ce71b2 commit 6e0c0ed
Show file tree
Hide file tree
Showing 2 changed files with 221 additions and 43 deletions.
260 changes: 219 additions & 41 deletions NetCord/Permissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,223 @@
[Flags]
public enum Permissions : ulong
{
CreateInstantInvite = (ulong)1 << 0,
KickUsers = (ulong)1 << 1,
BanUsers = (ulong)1 << 2,
Administrator = (ulong)1 << 3,
ManageChannels = (ulong)1 << 4,
ManageGuild = (ulong)1 << 5,
AddReactions = (ulong)1 << 6,
ViewAuditLog = (ulong)1 << 7,
PrioritySpeaker = (ulong)1 << 8,
Stream = (ulong)1 << 9,
ViewChannel = (ulong)1 << 10,
SendMessages = (ulong)1 << 11,
SendTtsMessages = (ulong)1 << 12,
ManageMessages = (ulong)1 << 13,
EmbedLinks = (ulong)1 << 14,
AttachFiles = (ulong)1 << 15,
ReadMessageHistory = (ulong)1 << 16,
MentionEveryone = (ulong)1 << 17,
UseExternalEmojis = (ulong)1 << 18,
ViewGuildInsights = (ulong)1 << 19,
Connect = (ulong)1 << 20,
Speak = (ulong)1 << 21,
MuteUsers = (ulong)1 << 22,
DeafenUsers = (ulong)1 << 23,
MoveUsers = (ulong)1 << 24,
UseVoiceActivityDetection = (ulong)1 << 25,
ChangeNickname = (ulong)1 << 26,
ManageNicknames = (ulong)1 << 27,
ManageRoles = (ulong)1 << 28,
ManageWebhooks = (ulong)1 << 29,
ManageEmojisAndStickers = (ulong)1 << 30,
UseApplicationCommands = (ulong)1 << 31,
RequestToSpeak = (ulong)1 << 32,
ManageEvents = (ulong)1 << 33,
ManageThreads = (ulong)1 << 34,
CreatePublicThreads = (ulong)1 << 35,
CreatePrivateThreads = (ulong)1 << 36,
UseExternalStickers = (ulong)1 << 37,
SendMessagesInThreads = (ulong)1 << 38,
StartEmbeddedActivities = (ulong)1 << 39,
ModerateUsers = (ulong)1 << 40,
/// <summary>
/// Allows creation of instant invites.
/// </summary>
CreateInstantInvite = 1uL << 0,

/// <summary>
/// Allows kicking guild users.
/// </summary>
KickUsers = 1uL << 1,

/// <summary>
/// Allows banning guild users.
/// </summary>
BanUsers = 1uL << 2,

/// <summary>
/// Allows all permissions and bypasses channel permission overwrites.
/// </summary>
Administrator = 1uL << 3,

/// <summary>
/// Allows management and editing of channels.
/// </summary>
ManageChannels = 1uL << 4,

/// <summary>
/// Allows management and editing of the guild.
/// </summary>
ManageGuild = 1uL << 5,

/// <summary>
/// Allows for the addition of reactions to messages.
/// </summary>
AddReactions = 1uL << 6,

/// <summary>
/// Allows for viewing of audit logs.
/// </summary>
ViewAuditLog = 1uL << 7,

/// <summary>
/// Allows for using priority speaker in a voice channel.
/// </summary>
PrioritySpeaker = 1uL << 8,

/// <summary>
/// Allows the user to go live.
/// </summary>
Stream = 1uL << 9,

/// <summary>
/// Allows guild users to view a channel, which includes reading messages in text channels and joining voice channels.
/// </summary>
ViewChannel = 1uL << 10,

/// <summary>
/// Allows for sending messages in a channel and creating threads in a forum (does not allow sending messages in threads).
/// </summary>
SendMessages = 1uL << 11,

/// <summary>
/// Allows for sending of /tts messages.
/// </summary>
SendTtsMessages = 1uL << 12,

/// <summary>
/// Allows for deletion of other users messages.
/// </summary>
ManageMessages = 1uL << 13,

/// <summary>
/// Links sent by users with this permission will be auto-embedded.
/// </summary>
EmbedLinks = 1uL << 14,

/// <summary>
/// Allows for uploading images and files.
/// </summary>
AttachFiles = 1uL << 15,

/// <summary>
/// Allows for reading of message history.
/// </summary>
ReadMessageHistory = 1uL << 16,

/// <summary>
/// Allows for using the <see langword="@everyone"/> tag to notify all users in a channel, and the <see langword="@here"/> tag to notify all online users in a channel.
/// </summary>
MentionEveryone = 1uL << 17,

/// <summary>
/// Allows the usage of custom emojis from other servers.
/// </summary>
UseExternalEmojis = 1uL << 18,

/// <summary>
/// Allows for viewing guild insights.
/// </summary>
ViewGuildInsights = 1uL << 19,

/// <summary>
/// Allows for joining of a voice channel.
/// </summary>
Connect = 1uL << 20,

/// <summary>
/// Allows for speaking in a voice channel.
/// </summary>
Speak = 1uL << 21,

/// <summary>
/// Allows for muting users in a voice channel.
/// </summary>
MuteUsers = 1uL << 22,

/// <summary>
/// Allows for deafening of users in a voice channel.
/// </summary>
DeafenUsers = 1uL << 23,

/// <summary>
/// Allows for moving of users between voice channels.
/// </summary>
MoveUsers = 1uL << 24,

/// <summary>
/// Allows for using voice-activity-detection in a voice channel.
/// </summary>
UseVoiceActivityDetection = 1uL << 25,

/// <summary>
/// Allows for modification of own nickname.
/// </summary>
ChangeNickname = 1uL << 26,

/// <summary>
/// Allows for modification of other users nicknames.
/// </summary>
ManageNicknames = 1uL << 27,

/// <summary>
/// Allows management and editing of roles.
/// </summary>
ManageRoles = 1uL << 28,

/// <summary>
/// Allows management and editing of webhooks.
/// </summary>
ManageWebhooks = 1uL << 29,

/// <summary>
/// Allows management and editing of emojis, stickers, and soundboard sounds.
/// </summary>
ManageGuildExpressions = 1uL << 30,

/// <summary>
/// Allows users to use application commands, including slash commands and context menu commands.
/// </summary>
UseApplicationCommands = 1uL << 31,

/// <summary>
/// Allows for requesting to speak in stage channels.
/// </summary>
RequestToSpeak = 1uL << 32,

/// <summary>
/// Allows for creating, editing, and deleting scheduled events.
/// </summary>
ManageEvents = 1uL << 33,

/// <summary>
/// Allows for deleting and archiving threads, and viewing all private threads.
/// </summary>
ManageThreads = 1uL << 34,

/// <summary>
/// Allows for creating public and announcement threads.
/// </summary>
CreatePublicThreads = 1uL << 35,

/// <summary>
/// Allows for creating private threads.
/// </summary>
CreatePrivateThreads = 1uL << 36,

/// <summary>
/// Allows the usage of custom stickers from other servers.
/// </summary>
UseExternalStickers = 1uL << 37,

/// <summary>
/// Allows for sending messages in threads.
/// </summary>
SendMessagesInThreads = 1uL << 38,

/// <summary>
/// Allows for using Activities (applications with the <see cref="ApplicationFlags.Embedded"/> flag) in a voice channel.
/// </summary>
StartEmbeddedActivities = 1uL << 39,

/// <summary>
/// Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.
/// </summary>
ModerateUsers = 1uL << 40,

/// <summary>
/// Allows for viewing role subscription insights.
/// </summary>
ViewCreatorMonetizationAnalytics = 1uL << 41,

/// <summary>
/// Allows for using soundboard in a voice channel.
/// </summary>
UseSoundboard = 1uL << 42,

/// <summary>
/// Allows the usage of custom soundboard sounds from other servers.
/// </summary>
UseExternalSounds = 1uL << 45,
}
4 changes: 2 additions & 2 deletions NetCord/Rest/AllowedMentionsProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace NetCord.Rest;
public partial class AllowedMentionsProperties
{
/// <summary>
/// Allow <see langword="@everyone"/> and <see langword="@here"/>.
/// Allows <see langword="@everyone"/> and <see langword="@here"/>.
/// </summary>
public bool Everyone { get; set; } = true;

Expand All @@ -22,7 +22,7 @@ public partial class AllowedMentionsProperties
public IEnumerable<ulong>? AllowedUsers { get; set; }

/// <summary>
/// Allow reply mention.
/// Allows reply mention.
/// </summary>
public bool ReplyMention { get; set; }

Expand Down

0 comments on commit 6e0c0ed

Please sign in to comment.