Browse Source

remove redundant code

pull/2507/head
Misha133 2 years ago
parent
commit
b55447fe1d
2 changed files with 2 additions and 25 deletions
  1. +1
    -24
      src/Discord.Net.Rest/Entities/Interactions/Modals/RestModalData.cs
  2. +1
    -1
      src/Discord.Net.WebSocket/Entities/Interaction/Modals/SocketModalData.cs

+ 1
- 24
src/Discord.Net.Rest/Entities/Interactions/Modals/RestModalData.cs View File

@@ -10,7 +10,7 @@ namespace Discord.Rest
/// <summary>
/// Represents data sent from a <see cref="InteractionType.ModalSubmit"/> Interaction.
/// </summary>
public class RestModalData : IComponentInteractionData, IModalInteractionData
public class RestModalData : IModalInteractionData
{
/// <inheritdoc/>
public string CustomId { get; }
@@ -20,29 +20,6 @@ namespace Discord.Rest
/// </summary>
public IReadOnlyCollection<RestMessageComponentData> Components { get; }

/// <inheritdoc/>
public ComponentType Type => throw new NotSupportedException("Modals do not have a component type.");

/// <inheritdoc/>
public IReadOnlyCollection<string> Values
=> throw new NotSupportedException("Modal interactions do not have values!");

/// <inheritdoc/>
public IReadOnlyCollection<IChannel> Channels
=> throw new NotSupportedException("Modal interactions do not have channels!");

/// <inheritdoc/>
public IReadOnlyCollection<IUser> Users
=> throw new NotSupportedException("Modal interactions do not have users!");

/// <inheritdoc/>
public IReadOnlyCollection<IRole> Roles
=> throw new NotSupportedException("Modal interactions do not have roles!");

/// <inheritdoc/>
public string Value
=> throw new NotSupportedException("Modal interactions do not have value!");

IReadOnlyCollection<IComponentInteractionData> IModalInteractionData.Components => Components;

internal RestModalData(Model model)


+ 1
- 1
src/Discord.Net.WebSocket/Entities/Interaction/Modals/SocketModalData.cs View File

@@ -10,7 +10,7 @@ namespace Discord.WebSocket
/// <summary>
/// Represents data sent from a <see cref="InteractionType.ModalSubmit"/>.
/// </summary>
public class SocketModalData : IDiscordInteractionData, IModalInteractionData
public class SocketModalData : IModalInteractionData
{
/// <summary>
/// Gets the <see cref="Modal"/>'s Custom Id.


Loading…
Cancel
Save