private async Task HandleInvalidInteraction(DiscordInteraction interaction) { var at = this.Config.ResponseBehavior switch { InteractionResponseBehavior.Ack => interaction.CreateResponseAsync(InteractionResponseType.DeferredMessageUpdate), InteractionResponseBehavior.Respond => interaction.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new() { Content = this.Config.ResponseMessage, IsEphemeral = true }), InteractionResponseBehavior.Ignore => Task.CompletedTask, _ => throw new ArgumentException("Unknown enum value.") }; await at; } }
private async Task AcknowledgeInteraction(DiscordInteraction interaction, bool ephemeral) { var builder = new DiscordInteractionResponseBuilder() .AsEphemeral(ephemeral); await interaction.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, builder); }