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