From f835beef10e0c63ff81c5edcf8d1230a3a570ee0 Mon Sep 17 00:00:00 2001 From: Raptorox <70806316+Raptorox@users.noreply.github.com> Date: Sat, 1 Aug 2026 14:20:49 +0200 Subject: [PATCH] add banlist --- src/command/banlist.rs | 40 ++++++++++++++++++++++++++++++++++++++++ src/command/mod.rs | 5 +++++ 2 files changed, 45 insertions(+) create mode 100644 src/command/banlist.rs diff --git a/src/command/banlist.rs b/src/command/banlist.rs new file mode 100644 index 0000000..dd227e5 --- /dev/null +++ b/src/command/banlist.rs @@ -0,0 +1,40 @@ +use std::marker::PhantomData; + +#[derive(Default)] +pub struct BanlistCommand { + state: PhantomData +} + +pub struct NoFilter; +pub struct Ips; +pub struct Players; + +impl BanlistCommand { + pub(crate) fn new() -> Self { + Self { state: PhantomData } + } + + pub fn players(self) -> BanlistCommand { + BanlistCommand { state: PhantomData } + } + + pub fn ips(self) -> BanlistCommand { + BanlistCommand { state: PhantomData } + } + + pub fn build(self) -> super::Command { + super::Command::raw("banlist") + } +} + +impl BanlistCommand { + pub fn build(self) -> super::Command { + super::Command::raw("banlist players") + } +} + +impl BanlistCommand { + pub fn build(self) -> super::Command { + super::Command::raw("banlist ips") + } +} \ No newline at end of file diff --git a/src/command/mod.rs b/src/command/mod.rs index bc8e79b..407e929 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -30,6 +30,7 @@ mod say; mod list; mod kill; mod ban; +mod banlist; impl Command { pub fn raw(cmd: &str) -> Self { @@ -55,4 +56,8 @@ impl Command { pub fn ban() -> ban::BanCommand { ban::BanCommand::default() } + + pub fn banlist() -> banlist::BanlistCommand { + banlist::BanlistCommand::new() + } } \ No newline at end of file