public async Task <Result <FeedbackMessage> > SetRoleplaySummaryAsync
        (
            string newRoleplaySummary,
            [RequireEntityOwner]
            [AutocompleteProvider("roleplay::owned")]
            Roleplay roleplay
        )
        {
            var result = await _discordRoleplays.SetRoleplaySummaryAsync(roleplay, newRoleplaySummary);

            return(!result.IsSuccess
                ? Result <FeedbackMessage> .FromError(result)
                : new FeedbackMessage("Roleplay summary set.", _feedback.Theme.Secondary));
        }
            public async Task <RuntimeResult> SetRoleplaySummaryAsync
            (
                string newRoleplaySummary,
                [RequireEntityOwnerOrPermission(typeof(EditRoleplay), PermissionTarget.Other)]
                Roleplay roleplay
            )
            {
                var result = await _discordRoleplays.SetRoleplaySummaryAsync(roleplay, newRoleplaySummary);

                if (!result.IsSuccess)
                {
                    return(result.ToRuntimeResult());
                }

                return(RuntimeCommandResult.FromSuccess("Roleplay summary set."));
            }
Example #3
0
            public async Task SetRoleplaySummaryAsync
            (
                string newRoleplaySummary,
                [RequireEntityOwnerOrPermission(typeof(EditRoleplay), PermissionTarget.Other)]
                Roleplay roleplay
            )
            {
                var result = await _discordRoleplays.SetRoleplaySummaryAsync(roleplay, newRoleplaySummary);

                if (!result.IsSuccess)
                {
                    await _feedback.SendErrorAsync(this.Context, result.ErrorReason);

                    return;
                }

                await _feedback.SendConfirmationAsync(this.Context, "Roleplay summary set.");
            }