public async Task <Result <FeedbackMessage> > CreateCharacterRoleAsync
        (
            IRole discordRole,
            RoleAccess access = RoleAccess.Open
        )
        {
            var createRoleResult = await _characterRoles.CreateCharacterRoleAsync
                                   (
                _context.GuildID.Value,
                discordRole.ID,
                access,
                this.CancellationToken
                                   );

            return(!createRoleResult.IsSuccess
                ? Result <FeedbackMessage> .FromError(createRoleResult)
                : new FeedbackMessage("Character role created.", _feedback.Theme.Secondary));
        }
Ejemplo n.º 2
0
            public async Task <RuntimeResult> CreateCharacterRoleAsync
            (
                IRole discordRole,
                RoleAccess access = RoleAccess.Open
            )
            {
                var createRoleResult = await _characterRoles.CreateCharacterRoleAsync
                                       (
                    discordRole,
                    access
                                       );

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

                return(RuntimeCommandResult.FromSuccess("Character role created."));
            }
            public async Task CreateCharacterRoleAsync
            (
                IRole discordRole,
                RoleAccess access = RoleAccess.Open
            )
            {
                var createRoleResult = await _characterRoles.CreateCharacterRoleAsync
                                       (
                    discordRole,
                    access
                                       );

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

                    return;
                }

                await _feedback.SendConfirmationAsync(this.Context, "Character role created.");
            }