Skip to content

Commit

Permalink
Remove restriction on interactions for deferred updates
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n3436 committed May 28, 2024
1 parent 4d7f864 commit ae6402e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/InteractiveGuards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ public static void ValidResponseType(InteractionResponseType responseType, [Call

public static void ValidResponseType(InteractionResponseType responseType, IDiscordInteraction interaction, [CallerArgumentExpression(nameof(responseType))] string? parameterName = null)
{
if (interaction is not IComponentInteraction &&
responseType is InteractionResponseType.DeferredUpdateMessage or InteractionResponseType.UpdateMessage)
if (interaction is not IComponentInteraction && responseType is InteractionResponseType.UpdateMessage)
{
throw new ArgumentException($"Interaction response type {responseType} can only be used on component interactions.", parameterName);
}
Expand Down
1 change: 0 additions & 1 deletion src/InteractiveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ await interaction.RespondWithFilesAsync(attachments ?? Enumerable.Empty<FileAtta
page.Text, embeds, page.IsTTS, ephemeral, page.AllowedMentions, component).ConfigureAwait(false);

case InteractionResponseType.DeferredUpdateMessage:
InteractiveGuards.ValidResponseType(responseType, interaction);
return await interaction.ModifyOriginalResponseAsync(UpdateMessage).ConfigureAwait(false);

case InteractionResponseType.UpdateMessage:
Expand Down

0 comments on commit ae6402e

Please sign in to comment.