Browse Source

fix oopsie

pull/2557/head
Cenngo 2 years ago
parent
commit
e0beb010ba
4 changed files with 7 additions and 61 deletions
  1. +1
    -5
      src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs
  2. +0
    -56
      src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs
  3. +3
    -0
      src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs
  4. +3
    -0
      src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs

+ 1
- 5
src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissionTarget.cs View File

@@ -12,10 +12,6 @@ namespace Discord
/// <summary>
/// The target of the permission is a user.
/// </summary>
User = 2,
/// <summary>
/// The target of the permission is a channel.
/// </summary>
Channel = 3
User = 2
}
}

+ 0
- 56
src/Discord.Net.Core/Entities/Permissions/ApplicationCommandPermissions.cs View File

@@ -58,61 +58,5 @@ namespace Discord
Permission = allow;
TargetType = ApplicationCommandPermissionTarget.Role;
}

/// <summary>
/// Creates a new <see cref="ApplicationCommandPermission"/> targeting <see cref="ApplicationCommandPermissionTarget.Channel"/>.
/// </summary>
/// <param name="channel">The channel you want to target this permission value for.</param>
/// <param name="allow">The value of this permission.</param>
public ApplicationCommandPermission(IChannel channel, bool allow)
{
TargetId = channel.Id;
Permission = allow;
TargetType = ApplicationCommandPermissionTarget.Channel;
}

/// <summary>
/// Creates a new <see cref="ApplicationCommandPermission"/> targeting @everyone in a guild.
/// </summary>
/// <param name="guildId">Id of the target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting @everyone in a guild.
/// </returns>
public static ApplicationCommandPermission ForEveryone(ulong guildId, bool allow) =>
new (guildId, ApplicationCommandPermissionTarget.User, allow);

/// <summary>
/// Creates a new <see cref="ApplicationCommandPermission"/> targeting @everyone in a guild.
/// </summary>
/// <param name="guild">Target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting @everyone in a guild.
/// </returns>
public static ApplicationCommandPermission ForEveryone(IGuild guild, bool allow) =>
ForEveryone(guild.Id, allow);

/// <summary>
/// Creates a new <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
/// </summary>
/// <param name="guildId">Id of the target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
/// </returns>
public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow) =>
new (guildId - 1, ApplicationCommandPermissionTarget.Channel, allow);

/// <summary>
/// Creates a new <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
/// </summary>
/// <param name="guild">Target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
/// </returns>
public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow) =>
ForAllChannels(guild.Id, allow);
}
}

+ 3
- 0
src/Discord.Net.Interactions/Attributes/Commands/ComponentInteractionAttribute.cs View File

@@ -32,6 +32,9 @@ namespace Discord.Interactions
/// <summary>
/// Gets or sets whether the <see cref="CustomId"/> should be treated as a raw Regex pattern.
/// </summary>
/// <remarks>
/// <see langword="false"/> defaults to the pattern used before 3.9.0.
/// </remarks>
public bool TreatAsRegex { get; set; } = false;

/// <summary>


+ 3
- 0
src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs View File

@@ -31,6 +31,9 @@ namespace Discord.Interactions
/// <summary>
/// Gets or sets whether the <see cref="CustomId"/> should be treated as a raw Regex pattern.
/// </summary>
/// <remarks>
/// <see langword="false"/> defaults to the pattern used before 3.9.0.
/// </remarks>
public bool TreatAsRegex { get; set; } = false;

/// <summary>


Loading…
Cancel
Save