From 9ff3aad199ddcf4a3e929587fa9a61df0310e736 Mon Sep 17 00:00:00 2001 From: Raptorox <70806316+Raptorox@users.noreply.github.com> Date: Sat, 1 Aug 2026 13:42:58 +0200 Subject: [PATCH] add ip opt for ban --- src/command/ban.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/command/ban.rs b/src/command/ban.rs index cb18e91..9c27b3f 100644 --- a/src/command/ban.rs +++ b/src/command/ban.rs @@ -1,7 +1,8 @@ #[derive(Default)] pub struct BanCommand { target: Option, - reason: Option + reason: Option, + ip: Option } impl BanCommand { @@ -15,9 +16,15 @@ impl BanCommand { self } + pub fn ip(mut self) -> Self { + self.ip = Some(true); + self + } + pub fn build(self) -> super::Command { let target = self.target.unwrap_or(super::Selector::Player("nonexistent".to_string())); - let mut s = format!("ban {target}"); + let ip = self.ip.unwrap_or(false); + let mut s = if ip { format!("ban-ip {target}") } else { format!("ban {target}") }; if let Some(reason) = self.reason { s.push_str(&format!(" {reason}")); };