コード例 #1
0
        public async Task <Result <FeedbackMessage> > RemoveConditionAsync
        (
            [DiscordTypeHint(TypeHint.Role)] AutoroleConfiguration autorole,
            long conditionID
        )
        {
            var removeCondition = await _autoroles.RemoveConditionAsync(autorole, conditionID);

            return(!removeCondition.IsSuccess
                ? Result <FeedbackMessage> .FromError(removeCondition)
                : new FeedbackMessage("Condition removed.", _feedback.Theme.Secondary));
        }
コード例 #2
0
            public async Task <RuntimeResult> RemoveConditionAsync
            (
                AutoroleConfiguration autorole,
                long conditionID
            )
            {
                var removeCondition = await _autoroles.RemoveConditionAsync(autorole, conditionID);

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

                return(RuntimeCommandResult.FromSuccess("Condition removed."));
            }
            public async Task RemoveConditionAsync
            (
                AutoroleConfiguration autorole,
                long conditionID
            )
            {
                var removeCondition = await _autoroles.RemoveConditionAsync(autorole, conditionID);

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

                    return;
                }

                await _feedback.SendConfirmationAsync(this.Context, "Condition removed.");
            }