public async Task DenyRequestAsync([Summary("The Input must be \"all\" or a digit greater than 0 and lower or equal to the number of requests pending approval.")] string inputIndex) { EmbedBuilder builder = new EmbedBuilder(); List <string> requests = Data.GetContainers <string>(Data.FILE_PATH + Data.REQUEST_FILE); if (requests != null) { if (inputIndex.ToLower() == "all") { while (requests.Count() > 0) { RemoveRequest(0); } builder.WithColor(Data.COLOR_SUCCESS) .WithTitle("All requests denied successfully") .WithDescription("All requests have been denied and removed from the list."); } else if (int.TryParse(inputIndex, out int index)) { if (index > 0 && index <= requests.Count()) { index--; //So the index matches the arrays and lists, starting at 0. string output = RemoveRequest(index); builder.WithColor(Data.COLOR_SUCCESS) .WithTitle("Request denied successfully") .WithDescription(output); } else { builder.WithColor(Data.COLOR_ERROR) .WithTitle("Failed to deny request") .WithDescription("`" + inputIndex + "` is invalid. Input must be \"all\" or a digit, greater than 0 and lower or equal to the number of requests pending approval."); } } else { builder.WithColor(Data.COLOR_ERROR) .WithTitle("Failed to deny request") .WithDescription("`" + inputIndex + "` is invalid. Input must be \"all\" or a digit, greater than 0 and lower or equal to the number of requests pending approval."); } } else { builder.WithColor(Data.COLOR_ERROR) .WithTitle("Failed to deny request") .WithDescription("Unable to find and retrieve request list."); } UpdateServerRequestInfo(); IMessage m = await ReplyAsync( embed : builder .WithAutoDeletionFooter() .Build()); await Task.Delay(Data.MESSAGE_DELETE_DELAY * 1000); await m.DeleteAsync(); await Context.Message.DeleteAsync(); }