public async Task <Result <FeedbackMessage> > SetBanReasonAsync(long banID, string newReason) { var getBan = await _bans.GetBanAsync(_context.GuildID.Value, banID); if (!getBan.IsSuccess) { return(Result <FeedbackMessage> .FromError(getBan)); } var ban = getBan.Entity; var setContents = await _bans.SetBanReasonAsync(ban, newReason); return(setContents.IsSuccess ? new FeedbackMessage("Ban reason updated.", _feedback.Theme.Secondary) : Result <FeedbackMessage> .FromError(setContents)); }
public async Task <RuntimeResult> SetBanReasonAsync(long banID, string newReason) { var getBan = await _bans.GetBanAsync(this.Context.Guild, banID); if (!getBan.IsSuccess) { return(getBan.ToRuntimeResult()); } var ban = getBan.Entity; var setContents = await _bans.SetBanReasonAsync(ban, newReason); if (!setContents.IsSuccess) { return(setContents.ToRuntimeResult()); } return(RuntimeCommandResult.FromSuccess("Ban reason updated.")); }
public async Task SetBanReasonAsync(long banID, string newReason) { var getBan = await _bans.GetBanAsync(this.Context.Guild, banID); if (!getBan.IsSuccess) { await _feedback.SendErrorAsync(this.Context, getBan.ErrorReason); return; } var ban = getBan.Entity; var setContents = await _bans.SetBanReasonAsync(ban, newReason); if (!setContents.IsSuccess) { await _feedback.SendErrorAsync(this.Context, setContents.ErrorReason); return; } await _feedback.SendConfirmationAsync(this.Context, "Ban reason updated."); }