Add BypassSlowmode permission (#3228)
This commit is contained in:
@@ -212,5 +212,10 @@ namespace Discord
|
||||
/// Allows pinning and unpinning messages.
|
||||
/// </summary>
|
||||
PinMessages = 1L << 51,
|
||||
|
||||
/// <summary>
|
||||
/// Allows bypassing slowmode restrictions.
|
||||
/// </summary>
|
||||
BypassSlowmode = 1L << 52,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@ namespace Discord
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ChannelPermissions"/> that grants all permissions for text channels.
|
||||
/// </summary>
|
||||
public static readonly ChannelPermissions Text = new(0b1110_110001_001111_110010_110011_111101_111111_111101_010001);
|
||||
public static readonly ChannelPermissions Text = new(0b11110_110001_001111_110010_110011_111101_111111_111101_010001);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ChannelPermissions"/> that grants all permissions for voice channels.
|
||||
/// </summary>
|
||||
public static readonly ChannelPermissions Voice = new(0b0111_110101_001010_001010_110011_111101_111111_111101_010001);
|
||||
public static readonly ChannelPermissions Voice = new(0b10111_110101_001010_001010_110011_111101_111111_111101_010001);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ChannelPermissions"/> that grants all permissions for stage channels.
|
||||
/// </summary>
|
||||
public static readonly ChannelPermissions Stage = new(0b0110_110100_000010_001110_010001_010101_111111_111001_010001);
|
||||
public static readonly ChannelPermissions Stage = new(0b10110_110100_000010_001110_010001_010101_111111_111001_010001);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ChannelPermissions"/> that grants all permissions for category channels.
|
||||
@@ -160,6 +160,8 @@ namespace Discord
|
||||
public bool UseExternalSounds => Permissions.GetValue(RawValue, ChannelPermission.UseExternalSounds);
|
||||
/// <summary> If <see langword="true"/>, a user can ping and unpin messages.</summary>
|
||||
public bool PinMessages => Permissions.GetValue(RawValue, ChannelPermission.PinMessages);
|
||||
/// <summary> If <see langword="true"/>, a user may bypass slowmode restrictions.</summary>
|
||||
public bool BypassSlowmode => Permissions.GetValue(RawValue, ChannelPermission.BypassSlowmode);
|
||||
|
||||
/// <summary> Creates a new <see cref="ChannelPermissions"/> with the provided packed value.</summary>
|
||||
public ChannelPermissions(ulong rawValue) { RawValue = rawValue; }
|
||||
@@ -203,7 +205,8 @@ namespace Discord
|
||||
bool? sendPolls = null,
|
||||
bool? useExternalApps = null,
|
||||
bool? useExternalSounds = null,
|
||||
bool? pinMessages = null)
|
||||
bool? pinMessages = null,
|
||||
bool? bypassSlowmode = null)
|
||||
{
|
||||
ulong value = initialValue;
|
||||
|
||||
@@ -246,6 +249,7 @@ namespace Discord
|
||||
Permissions.SetValue(ref value, useExternalApps, ChannelPermission.UseExternalApps);
|
||||
Permissions.SetValue(ref value, useExternalSounds, ChannelPermission.UseExternalSounds);
|
||||
Permissions.SetValue(ref value, pinMessages, ChannelPermission.PinMessages);
|
||||
Permissions.SetValue(ref value, bypassSlowmode, ChannelPermission.BypassSlowmode);
|
||||
|
||||
RawValue = value;
|
||||
}
|
||||
@@ -290,13 +294,14 @@ namespace Discord
|
||||
bool sendPolls = false,
|
||||
bool useExternalApps = false,
|
||||
bool useExternalSounds = false,
|
||||
bool pinMessages = false)
|
||||
bool pinMessages = false,
|
||||
bool bypassSlowmode = false)
|
||||
: this(0, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages,
|
||||
embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect,
|
||||
speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, prioritySpeaker, stream, manageRoles, manageWebhooks,
|
||||
useApplicationCommands, requestToSpeak, manageThreads, createPublicThreads, createPrivateThreads, useExternalStickers, sendMessagesInThreads,
|
||||
startEmbeddedActivities, useSoundboard, createEvents, sendVoiceMessages, useClydeAI, setVoiceChannelStatus, sendPolls, useExternalApps,
|
||||
useExternalSounds, pinMessages)
|
||||
useExternalSounds, pinMessages, bypassSlowmode)
|
||||
{ }
|
||||
|
||||
/// <summary> Creates a new <see cref="ChannelPermissions"/> from this one, changing the provided non-null permissions.</summary>
|
||||
@@ -339,7 +344,8 @@ namespace Discord
|
||||
bool? sendPolls = null,
|
||||
bool? useExternalApps = null,
|
||||
bool? useExternalSounds = null,
|
||||
bool? pinMessages = null)
|
||||
bool? pinMessages = null,
|
||||
bool? bypassSlowmode = null)
|
||||
=> new ChannelPermissions(RawValue,
|
||||
createInstantInvite,
|
||||
manageChannel,
|
||||
@@ -379,7 +385,8 @@ namespace Discord
|
||||
sendPolls,
|
||||
useExternalApps,
|
||||
useExternalSounds,
|
||||
pinMessages);
|
||||
pinMessages,
|
||||
bypassSlowmode);
|
||||
|
||||
public bool Has(ChannelPermission permission) => Permissions.GetValue(RawValue, permission);
|
||||
|
||||
|
||||
@@ -307,5 +307,10 @@ namespace Discord
|
||||
/// Allows pinning and unpinning messages.
|
||||
/// </summary>
|
||||
PinMessages = 1L << 51,
|
||||
|
||||
/// <summary>
|
||||
/// Allows bypassing slowmode restrictions.
|
||||
/// </summary>
|
||||
BypassSlowmode = 1L << 52,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,8 @@ namespace Discord
|
||||
public bool CreateEvents => Permissions.GetValue(RawValue, GuildPermission.CreateEvents);
|
||||
/// <summary> If <see langword="true"/>, a user can ping and unpin messages.</summary>
|
||||
public bool PinMessages => Permissions.GetValue(RawValue, GuildPermission.PinMessages);
|
||||
/// <summary> If <see langword="true"/>, a user may bypass slowmode restrictions. </summary>
|
||||
public bool BypassSlowmode => Permissions.GetValue(RawValue, GuildPermission.BypassSlowmode);
|
||||
|
||||
/// <summary> Creates a new <see cref="GuildPermissions"/> with the provided packed value. </summary>
|
||||
public GuildPermissions(ulong rawValue) { RawValue = rawValue; }
|
||||
@@ -185,7 +187,8 @@ namespace Discord
|
||||
bool? useExternalApps = null,
|
||||
bool? useExternalSounds = null,
|
||||
bool? createEvents = null,
|
||||
bool? pinMessages = null)
|
||||
bool? pinMessages = null,
|
||||
bool? bypassSlowmode = null)
|
||||
{
|
||||
ulong value = initialValue;
|
||||
|
||||
@@ -241,6 +244,7 @@ namespace Discord
|
||||
Permissions.SetValue(ref value, useExternalSounds, GuildPermission.UseExternalSounds);
|
||||
Permissions.SetValue(ref value, createEvents, GuildPermission.CreateEvents);
|
||||
Permissions.SetValue(ref value, pinMessages, GuildPermission.PinMessages);
|
||||
Permissions.SetValue(ref value, bypassSlowmode, GuildPermission.BypassSlowmode);
|
||||
|
||||
RawValue = value;
|
||||
}
|
||||
@@ -298,7 +302,8 @@ namespace Discord
|
||||
bool useExternalApps = false,
|
||||
bool useExternalSounds = false,
|
||||
bool createEvents = false,
|
||||
bool pinMessages = false)
|
||||
bool pinMessages = false,
|
||||
bool bypassSlowmode = false)
|
||||
: this(0,
|
||||
createInstantInvite: createInstantInvite,
|
||||
manageRoles: manageRoles,
|
||||
@@ -351,7 +356,8 @@ namespace Discord
|
||||
useExternalApps: useExternalApps,
|
||||
useExternalSounds: useExternalSounds,
|
||||
createEvents: createEvents,
|
||||
pinMessages: pinMessages)
|
||||
pinMessages: pinMessages,
|
||||
bypassSlowmode: bypassSlowmode)
|
||||
{ }
|
||||
|
||||
/// <summary> Creates a new <see cref="GuildPermissions"/> from this one, changing the provided non-null permissions. </summary>
|
||||
@@ -407,14 +413,15 @@ namespace Discord
|
||||
bool? useExternalApps = null,
|
||||
bool? useExternalSounds = null,
|
||||
bool? createEvents = null,
|
||||
bool? pinMessages = null)
|
||||
bool? pinMessages = null,
|
||||
bool? bypassSlowmode = null)
|
||||
=> new GuildPermissions(RawValue, createInstantInvite, kickMembers, banMembers, administrator, manageChannels, manageGuild, addReactions,
|
||||
viewAuditLog, viewGuildInsights, viewChannel, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles,
|
||||
readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers,
|
||||
useVoiceActivation, prioritySpeaker, stream, changeNickname, manageNicknames, manageRoles, manageWebhooks, manageEmojisAndStickers,
|
||||
useApplicationCommands, requestToSpeak, manageEvents, manageThreads, createPublicThreads, createPrivateThreads, useExternalStickers, sendMessagesInThreads,
|
||||
startEmbeddedActivities, moderateMembers, useSoundboard, viewMonetizationAnalytics, sendVoiceMessages, useClydeAI, createGuildExpressions, setVoiceChannelStatus,
|
||||
sendPolls, useExternalApps, useExternalSounds, createEvents, pinMessages);
|
||||
sendPolls, useExternalApps, useExternalSounds, createEvents, pinMessages, bypassSlowmode);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value that indicates if a specific <see cref="GuildPermission"/> is enabled
|
||||
|
||||
Reference in New Issue
Block a user