/// <summary> /// Updates the contents of the wizard. /// </summary> /// <param name="data">The wizard's state.</param> /// <returns>A result which may or may not have succeeded.</returns> private async Task <Result> UpdateAsync ( KinkWizard data ) { var getPage = await data.GetCurrentPageAsync(_kinks, this.CancellationToken); if (!getPage.IsSuccess) { return(Result.FromError(getPage)); } var page = getPage.Entity; if (data.WasCreatedWithInteraction) { return((Result)await _interactionAPI.EditOriginalInteractionResponseAsync ( _context.ApplicationID, _context.Token, embeds : new[] { page }, components : new Optional <IReadOnlyList <IMessageComponent>?>(data.GetCurrentPageComponents()), ct : this.CancellationToken )); } var message = _context.Message.Value; return((Result)await _channelAPI.EditMessageAsync ( message.ChannelID, message.ID, embeds : new[] { page }, components : new Optional <IReadOnlyList <IMessageComponent>?>(data.GetCurrentPageComponents()), ct : this.CancellationToken )); }