public async Task <RuntimeResult> SetAffirmationRequirementAsync ( AutoroleConfiguration autorole, bool requireAffirmation = true ) { var setRequirementResult = await _autoroles.SetAffirmationRequiredAsync(autorole, requireAffirmation); if (!setRequirementResult.IsSuccess) { return(setRequirementResult.ToRuntimeResult()); } await _feedback.SendConfirmationAsync ( this.Context, requireAffirmation? "Affirmation is now required." : "Affirmation is no longer required." ); return(RuntimeCommandResult.FromSuccess()); }
public async Task <Result <FeedbackMessage> > SetAffirmationRequirementAsync ( [DiscordTypeHint(TypeHint.Role)] AutoroleConfiguration autorole, bool requireAffirmation = true ) { var setRequirementResult = await _autoroles.SetAffirmationRequiredAsync(autorole, requireAffirmation); if (!setRequirementResult.IsSuccess) { return(Result <FeedbackMessage> .FromError(setRequirementResult)); } return(new FeedbackMessage ( requireAffirmation ? "Affirmation is now required." : "Affirmation is no longer required.", _feedback.Theme.Secondary )); }
public async Task SetAffirmationRequirementAsync ( AutoroleConfiguration autorole, bool requireAffirmation = true ) { var setRequirementResult = await _autoroles.SetAffirmationRequiredAsync(autorole, requireAffirmation); if (!setRequirementResult.IsSuccess) { await _feedback.SendErrorAsync(this.Context, setRequirementResult.ErrorReason); return; } await _feedback.SendConfirmationAsync ( this.Context, requireAffirmation? "Affirmation is now required." : "Affirmation is no longer required." ); }