diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 0db6985b0..f132cb7a4 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -897,7 +897,7 @@ namespace Discord.API } #endregion - #region Stickers + #region Stickers, Reactions, Crosspost, and Acks public async Task GetStickerAsync(ulong id, RequestOptions options = null) { Preconditions.NotEqual(id, 0, nameof(id)); @@ -1166,25 +1166,25 @@ namespace Discord.API options = RequestOptions.CreateOrClone(options); - return await TrySendApplicationCommand(SendJsonAsync("POST", () => $"applications/{this.CurrentUserId}/commands", command, new BucketIds(), options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("POST", () => $"applications/{this.CurrentUserId}/commands", command, new BucketIds(), options: options)).ConfigureAwait(false); } public async Task ModifyGlobalApplicationCommandAsync(ModifyApplicationCommandParams command, ulong commandId, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); - return await TrySendApplicationCommand(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); } public async Task ModifyGlobalApplicationUserCommandAsync(ModifyApplicationCommandParams command, ulong commandId, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); - return await TrySendApplicationCommand(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); } public async Task ModifyGlobalApplicationMessageCommandAsync(ModifyApplicationCommandParams command, ulong commandId, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); - return await TrySendApplicationCommand(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/commands/{commandId}", command, new BucketIds(), options: options)).ConfigureAwait(false); } public async Task DeleteGlobalApplicationCommandAsync(ulong commandId, RequestOptions options = null) { @@ -1193,11 +1193,11 @@ namespace Discord.API await SendAsync("DELETE", () => $"applications/{this.CurrentUserId}/commands/{commandId}", new BucketIds(), options: options).ConfigureAwait(false); } - public async Task BulkOverwriteGlobalApplicationCommands(CreateApplicationCommandParams[] commands, RequestOptions options = null) + public async Task BulkOverwriteGlobalApplicationCommandsAsync(CreateApplicationCommandParams[] commands, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); - return await TrySendApplicationCommand(SendJsonAsync("PUT", () => $"applications/{this.CurrentUserId}/commands", commands, new BucketIds(), options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PUT", () => $"applications/{this.CurrentUserId}/commands", commands, new BucketIds(), options: options)).ConfigureAwait(false); } public async Task GetGuildApplicationCommandsAsync(ulong guildId, RequestOptions options = null) @@ -1239,7 +1239,7 @@ namespace Discord.API var bucket = new BucketIds(guildId: guildId); - return await TrySendApplicationCommand(SendJsonAsync("POST", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands", command, bucket, options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("POST", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands", command, bucket, options: options)).ConfigureAwait(false); } public async Task ModifyGuildApplicationCommandAsync(ModifyApplicationCommandParams command, ulong guildId, ulong commandId, RequestOptions options = null) { @@ -1247,7 +1247,7 @@ namespace Discord.API var bucket = new BucketIds(guildId: guildId); - return await TrySendApplicationCommand(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/{commandId}", command, bucket, options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PATCH", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/{commandId}", command, bucket, options: options)).ConfigureAwait(false); } public async Task DeleteGuildApplicationCommandAsync(ulong guildId, ulong commandId, RequestOptions options = null) { @@ -1258,18 +1258,18 @@ namespace Discord.API await SendAsync("DELETE", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/{commandId}", bucket, options: options).ConfigureAwait(false); } - public async Task BulkOverwriteGuildApplicationCommands(ulong guildId, CreateApplicationCommandParams[] commands, RequestOptions options = null) + public async Task BulkOverwriteGuildApplicationCommandsAsync(ulong guildId, CreateApplicationCommandParams[] commands, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); var bucket = new BucketIds(guildId: guildId); - return await TrySendApplicationCommand(SendJsonAsync("PUT", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands", commands, bucket, options: options)).ConfigureAwait(false); + return await TrySendApplicationCommandAsync(SendJsonAsync("PUT", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands", commands, bucket, options: options)).ConfigureAwait(false); } #endregion #region Interaction Responses - public async Task CreateInteractionResponse(InteractionResponse response, ulong interactionId, string interactionToken, RequestOptions options = null) + public async Task CreateInteractionResponseAsync(InteractionResponse response, ulong interactionId, string interactionToken, RequestOptions options = null) { if(response.Data.IsSpecified && response.Data.Value.Content.IsSpecified) Preconditions.AtMost(response.Data.Value.Content.Value?.Length ?? 0, 2000, nameof(response.Data.Value.Content)); @@ -1278,7 +1278,7 @@ namespace Discord.API await SendJsonAsync("POST", () => $"interactions/{interactionId}/{interactionToken}/callback", response, new BucketIds(), options: options); } - public async Task GetInteractionResponse(string interactionToken, RequestOptions options = null) + public async Task GetInteractionResponseAsync(string interactionToken, RequestOptions options = null) { Preconditions.NotNullOrEmpty(interactionToken, nameof(interactionToken)); @@ -1286,20 +1286,20 @@ namespace Discord.API return await SendAsync("GET", () => $"webhooks/{this.CurrentUserId}/{interactionToken}/messages/@original", new BucketIds(), options: options).ConfigureAwait(false); } - public async Task ModifyInteractionResponse(ModifyInteractionResponseParams args, string interactionToken, RequestOptions options = null) + public async Task ModifyInteractionResponseAsync(ModifyInteractionResponseParams args, string interactionToken, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); return await SendJsonAsync("PATCH", () => $"webhooks/{this.CurrentUserId}/{interactionToken}/messages/@original", args, new BucketIds(), options: options); } - public async Task DeleteInteractionResponse(string interactionToken, RequestOptions options = null) + public async Task DeleteInteractionResponseAsync(string interactionToken, RequestOptions options = null) { options = RequestOptions.CreateOrClone(options); await SendAsync("DELETE", () => $"webhooks/{this.CurrentUserId}/{interactionToken}/messages/@original", new BucketIds(), options: options); } - public async Task CreateInteractionFollowupMessage(CreateWebhookMessageParams args, string token, RequestOptions options = null) + public async Task CreateInteractionFollowupMessageAsync(CreateWebhookMessageParams args, string token, RequestOptions options = null) { if ((!args.Embeds.IsSpecified || args.Embeds.Value == null || args.Embeds.Value.Length == 0) && !args.File.IsSpecified) Preconditions.NotNullOrEmpty(args.Content, nameof(args.Content)); @@ -1315,7 +1315,7 @@ namespace Discord.API return await SendMultipartAsync("POST", () => $"webhooks/{CurrentUserId}/{token}?wait=true", args.ToDictionary(), new BucketIds(), options: options).ConfigureAwait(false); } - public async Task ModifyInteractionFollowupMessage(ModifyInteractionResponseParams args, ulong id, string token, RequestOptions options = null) + public async Task ModifyInteractionFollowupMessageAsync(ModifyInteractionResponseParams args, ulong id, string token, RequestOptions options = null) { Preconditions.NotNull(args, nameof(args)); Preconditions.NotEqual(id, 0, nameof(id)); @@ -1329,7 +1329,7 @@ namespace Discord.API return await SendJsonAsync("PATCH", () => $"webhooks/{CurrentUserId}/{token}/messages/{id}", args, new BucketIds(), options: options).ConfigureAwait(false); } - public async Task DeleteInteractionFollowupMessage(ulong id, string token, RequestOptions options = null) + public async Task DeleteInteractionFollowupMessageAsync(ulong id, string token, RequestOptions options = null) { Preconditions.NotEqual(id, 0, nameof(id)); @@ -1340,7 +1340,7 @@ namespace Discord.API #endregion #region Application Command permissions - public async Task GetGuildApplicationCommandPermissions(ulong guildId, RequestOptions options = null) + public async Task GetGuildApplicationCommandPermissionsAsync(ulong guildId, RequestOptions options = null) { Preconditions.NotEqual(guildId, 0, nameof(guildId)); @@ -1349,7 +1349,7 @@ namespace Discord.API return await SendAsync("GET", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/permissions", new BucketIds(), options: options).ConfigureAwait(false); } - public async Task GetGuildApplicationCommandPermission(ulong guildId, ulong commandId, RequestOptions options = null) + public async Task GetGuildApplicationCommandPermissionAsync(ulong guildId, ulong commandId, RequestOptions options = null) { Preconditions.NotEqual(guildId, 0, nameof(guildId)); Preconditions.NotEqual(commandId, 0, nameof(commandId)); @@ -1359,7 +1359,7 @@ namespace Discord.API return await SendAsync("GET", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/{commandId}/permissions", new BucketIds(), options: options).ConfigureAwait(false); } - public async Task ModifyApplicationCommandPermissions(ModifyGuildApplicationCommandPermissionsParams permissions, ulong guildId, ulong commandId, RequestOptions options = null) + public async Task ModifyApplicationCommandPermissionsAsync(ModifyGuildApplicationCommandPermissionsParams permissions, ulong guildId, ulong commandId, RequestOptions options = null) { Preconditions.NotEqual(guildId, 0, nameof(guildId)); Preconditions.NotEqual(commandId, 0, nameof(commandId)); @@ -1369,7 +1369,7 @@ namespace Discord.API return await SendJsonAsync("PUT", () => $"applications/{this.CurrentUserId}/guilds/{guildId}/commands/{commandId}/permissions", permissions, new BucketIds(), options: options).ConfigureAwait(false); } - public async Task> BatchModifyApplicationCommandPermissions(ModifyGuildApplicationCommandPermissions[] permissions, ulong guildId, RequestOptions options = null) + public async Task> BatchModifyApplicationCommandPermissionsAsync(ModifyGuildApplicationCommandPermissions[] permissions, ulong guildId, RequestOptions options = null) { Preconditions.NotEqual(guildId, 0, nameof(guildId)); Preconditions.NotNull(permissions, nameof(permissions)); @@ -2091,7 +2091,7 @@ namespace Discord.API return _serializer.Deserialize(reader); } - protected async Task TrySendApplicationCommand(Task sendTask) + protected async Task TrySendApplicationCommandAsync(Task sendTask) { try { diff --git a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs index 7a4b49166..e79cb6e2f 100644 --- a/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs +++ b/src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs @@ -14,31 +14,31 @@ namespace Discord.Rest #region InteractionHelper public static Task DeleteAllGuildCommandsAsync(BaseDiscordClient client, ulong guildId, RequestOptions options = null) { - return client.ApiClient.BulkOverwriteGuildApplicationCommands(guildId, new CreateApplicationCommandParams[0], options); + return client.ApiClient.BulkOverwriteGuildApplicationCommandsAsync(guildId, new CreateApplicationCommandParams[0], options); } public static Task DeleteAllGlobalCommandsAsync(BaseDiscordClient client, RequestOptions options = null) { - return client.ApiClient.BulkOverwriteGlobalApplicationCommands(new CreateApplicationCommandParams[0], options); + return client.ApiClient.BulkOverwriteGlobalApplicationCommandsAsync(new CreateApplicationCommandParams[0], options); } public static Task SendInteractionResponse(BaseDiscordClient client, InteractionResponse response, ulong interactionId, string interactionToken, RequestOptions options = null) { - return client.ApiClient.CreateInteractionResponse(response, interactionId, interactionToken, options); + return client.ApiClient.CreateInteractionResponseAsync(response, interactionId, interactionToken, options); } public static async Task GetOriginalResponseAsync(BaseDiscordClient client, IMessageChannel channel, IDiscordInteraction interaction, RequestOptions options = null) { - var model = await client.ApiClient.GetInteractionResponse(interaction.Token, options).ConfigureAwait(false); + var model = await client.ApiClient.GetInteractionResponseAsync(interaction.Token, options).ConfigureAwait(false); return RestInteractionMessage.Create(client, model, interaction.Token, channel); } public static async Task SendFollowupAsync(BaseDiscordClient client, CreateWebhookMessageParams args, string token, IMessageChannel channel, RequestOptions options = null) { - var model = await client.ApiClient.CreateInteractionFollowupMessage(args, token, options).ConfigureAwait(false); + var model = await client.ApiClient.CreateInteractionFollowupMessageAsync(args, token, options).ConfigureAwait(false); RestFollowupMessage entity = RestFollowupMessage.Create(client, model, token, channel); return entity; @@ -123,7 +123,7 @@ namespace Discord.Rest models.Add(model); } - return await client.ApiClient.BulkOverwriteGlobalApplicationCommands(models.ToArray(), options).ConfigureAwait(false); + return await client.ApiClient.BulkOverwriteGlobalApplicationCommandsAsync(models.ToArray(), options).ConfigureAwait(false); } public static async Task> BulkOverwriteGuildCommands(BaseDiscordClient client, ulong guildId, @@ -160,7 +160,7 @@ namespace Discord.Rest models.Add(model); } - return await client.ApiClient.BulkOverwriteGuildApplicationCommands(guildId, models.ToArray(), options).ConfigureAwait(false); + return await client.ApiClient.BulkOverwriteGuildApplicationCommandsAsync(guildId, models.ToArray(), options).ConfigureAwait(false); } private static TArg GetApplicationCommandProperties(IApplicationCommand command) @@ -367,11 +367,11 @@ namespace Discord.Rest Components = args.Components.IsSpecified ? args.Components.Value?.Components.Select(x => new API.ActionRowComponent(x)).ToArray() : Optional.Unspecified, }; - return await client.ApiClient.ModifyInteractionFollowupMessage(apiArgs, message.Id, message.Token, options).ConfigureAwait(false); + return await client.ApiClient.ModifyInteractionFollowupMessageAsync(apiArgs, message.Id, message.Token, options).ConfigureAwait(false); } public static async Task DeleteFollowupMessage(BaseDiscordClient client, RestFollowupMessage message, RequestOptions options = null) - => await client.ApiClient.DeleteInteractionFollowupMessage(message.Id, message.Token, options); + => await client.ApiClient.DeleteInteractionFollowupMessageAsync(message.Id, message.Token, options); public static async Task ModifyInteractionResponse(BaseDiscordClient client, string token, Action func, RequestOptions options = null) @@ -411,18 +411,18 @@ namespace Discord.Rest Flags = args.Flags }; - return await client.ApiClient.ModifyInteractionResponse(apiArgs, token, options).ConfigureAwait(false); + return await client.ApiClient.ModifyInteractionResponseAsync(apiArgs, token, options).ConfigureAwait(false); } public static async Task DeletedInteractionResponse(BaseDiscordClient client, RestInteractionMessage message, RequestOptions options = null) - => await client.ApiClient.DeleteInteractionFollowupMessage(message.Id, message.Token, options); + => await client.ApiClient.DeleteInteractionFollowupMessageAsync(message.Id, message.Token, options); #endregion #region Guild permissions public static async Task> GetGuildCommandPermissionsAsync(BaseDiscordClient client, ulong guildId, RequestOptions options) { - var models = await client.ApiClient.GetGuildApplicationCommandPermissions(guildId, options); + var models = await client.ApiClient.GetGuildApplicationCommandPermissionsAsync(guildId, options); return models.Select(x => new GuildApplicationCommandPermission(x.Id, x.ApplicationId, guildId, x.Permissions.Select( y => new Discord.ApplicationCommandPermission(y.Id, y.Type, y.Permission)) @@ -435,7 +435,7 @@ namespace Discord.Rest { try { - var model = await client.ApiClient.GetGuildApplicationCommandPermission(guildId, commandId, options); + var model = await client.ApiClient.GetGuildApplicationCommandPermissionAsync(guildId, commandId, options); return new GuildApplicationCommandPermission(model.Id, model.ApplicationId, guildId, model.Permissions.Select( y => new ApplicationCommandPermission(y.Id, y.Type, y.Permission)).ToArray()); } @@ -473,7 +473,7 @@ namespace Discord.Rest Permissions = permissionsList.ToArray() }; - var apiModel = await client.ApiClient.ModifyApplicationCommandPermissions(model, guildId, commandId, options); + var apiModel = await client.ApiClient.ModifyApplicationCommandPermissionsAsync(model, guildId, commandId, options); return new GuildApplicationCommandPermission(apiModel.Id, apiModel.ApplicationId, guildId, apiModel.Permissions.Select( x => new ApplicationCommandPermission(x.Id, x.Type, x.Permission)).ToArray()); @@ -505,7 +505,7 @@ namespace Discord.Rest models.Add(model); } - var apiModels = await client.ApiClient.BatchModifyApplicationCommandPermissions(models.ToArray(), guildId, options); + var apiModels = await client.ApiClient.BatchModifyApplicationCommandPermissionsAsync(models.ToArray(), guildId, options); return apiModels.Select( x => new GuildApplicationCommandPermission(x.Id, x.ApplicationId, x.GuildId, x.Permissions.Select( diff --git a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml index 61b96e0c9..2081ac0e9 100644 --- a/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml +++ b/src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml @@ -1393,29 +1393,6 @@ - - - Gets or sets whether or not interactions are acknowledge with source. - - - - Discord interactions will not appear in chat until the client responds to them. With this option set to - , the client will automatically acknowledge the interaction with . - See the docs on - responding to interactions for more info. - - - With this option set to , you will have to acknowledge the interaction with - . - Only after the interaction is acknowledged, the original slash command message will be visible. - - - Please note that manually acknowledging the interaction with a message reply will not provide any return data. - Automatically acknowledging the interaction without sending the message will allow for follow up responses to - be used; follow up responses return the message data sent. - - - Gets or sets the timeout for event handlers, in milliseconds, after which a warning will be logged. @@ -4207,7 +4184,7 @@ Responds to an Interaction with type . - If you have set to , You should use + If you have set to , You should use instead. diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 007e9f68a..2b9ac9ff8 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -72,8 +72,6 @@ namespace Discord.WebSocket internal WebSocketProvider WebSocketProvider { get; private set; } internal bool AlwaysDownloadUsers { get; private set; } internal int? HandlerTimeout { get; private set; } - internal bool AlwaysAcknowledgeInteractions { get; private set; } - internal new DiscordSocketApiClient ApiClient => base.ApiClient as DiscordSocketApiClient; /// public override IReadOnlyCollection Guilds => State.Guilds; @@ -143,7 +141,6 @@ namespace Discord.WebSocket UdpSocketProvider = config.UdpSocketProvider; WebSocketProvider = config.WebSocketProvider; AlwaysDownloadUsers = config.AlwaysDownloadUsers; - AlwaysAcknowledgeInteractions = config.AlwaysAcknowledgeInteractions; HandlerTimeout = config.HandlerTimeout; State = new ClientState(0, 0); Rest = new DiscordSocketRestClient(config, ApiClient); @@ -2095,9 +2092,6 @@ namespace Discord.WebSocket var interaction = SocketInteraction.Create(this, data, channel as ISocketMessageChannel); - if (this.AlwaysAcknowledgeInteractions) - await interaction.DeferAsync().ConfigureAwait(false); - await TimedInvokeAsync(_interactionCreatedEvent, nameof(InteractionCreated), interaction).ConfigureAwait(false); switch (interaction) diff --git a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs index 6ce9489f6..22a201c67 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketConfig.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketConfig.cs @@ -105,29 +105,6 @@ namespace Discord.WebSocket /// public bool AlwaysDownloadUsers { get; set; } = false; - /// - /// Gets or sets whether or not interactions are acknowledge with source. - /// - /// - /// - /// Discord interactions will not appear in chat until the client responds to them. With this option set to - /// , the client will automatically acknowledge the interaction with . - /// See the docs on - /// responding to interactions for more info. - /// - /// - /// With this option set to , you will have to acknowledge the interaction with - /// . - /// Only after the interaction is acknowledged, the original slash command message will be visible. - /// - /// - /// Please note that manually acknowledging the interaction with a message reply will not provide any return data. - /// Automatically acknowledging the interaction without sending the message will allow for follow up responses to - /// be used; follow up responses return the message data sent. - /// - /// - public bool AlwaysAcknowledgeInteractions { get; set; } = true; - /// /// Gets or sets the timeout for event handlers, in milliseconds, after which a warning will be logged. /// Setting this property to nulldisables this check. diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponent.cs b/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponent.cs index 2a3ee4ba3..5daffc2cd 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponent.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/Message Components/SocketMessageComponent.cs @@ -86,12 +86,6 @@ namespace Discord.WebSocket if (embeds == null && embed != null) embeds = new[] { embed }; - if (Discord.AlwaysAcknowledgeInteractions) - { - await FollowupAsync(text, embeds, isTTS, ephemeral, allowedMentions, options); - return; - } - Preconditions.AtMost(allowedMentions?.RoleIds?.Count ?? 0, 100, nameof(allowedMentions.RoleIds), "A max of 100 role Ids are allowed."); Preconditions.AtMost(allowedMentions?.UserIds?.Count ?? 0, 100, nameof(allowedMentions.UserIds), "A max of 100 user Ids are allowed."); Preconditions.AtMost(embeds?.Length ?? 0, 10, nameof(embeds), "A max of 10 embeds are allowed."); @@ -341,7 +335,7 @@ namespace Discord.WebSocket }; - return Discord.Rest.ApiClient.CreateInteractionResponse(response, this.Id, this.Token, options); + return Discord.Rest.ApiClient.CreateInteractionResponseAsync(response, this.Id, this.Token, options); } /// @@ -354,7 +348,7 @@ namespace Discord.WebSocket }; - return Discord.Rest.ApiClient.CreateInteractionResponse(response, this.Id, this.Token, options); + return Discord.Rest.ApiClient.CreateInteractionResponseAsync(response, this.Id, this.Token, options); } } } diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketCommandBase.cs b/src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketCommandBase.cs index 4161a8473..c65048a34 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketCommandBase.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketCommandBase.cs @@ -70,12 +70,6 @@ namespace Discord.WebSocket if (embeds == null && embed != null) embeds = new[] { embed }; - if (Discord.AlwaysAcknowledgeInteractions) - { - await FollowupAsync(text, embeds, isTTS, ephemeral, allowedMentions, options, component); - return; - } - Preconditions.AtMost(allowedMentions?.RoleIds?.Count ?? 0, 100, nameof(allowedMentions.RoleIds), "A max of 100 role Ids are allowed."); Preconditions.AtMost(allowedMentions?.UserIds?.Count ?? 0, 100, nameof(allowedMentions.UserIds), "A max of 100 user Ids are allowed."); Preconditions.AtMost(embeds?.Length ?? 0, 10, nameof(embeds), "A max of 10 embeds are allowed."); @@ -244,7 +238,7 @@ namespace Discord.WebSocket } }; - return Discord.Rest.ApiClient.CreateInteractionResponse(response, this.Id, this.Token, options); + return Discord.Rest.ApiClient.CreateInteractionResponseAsync(response, this.Id, this.Token, options); } } }