+use log::debug;
+use podman_api::opts::ContainerListOpts;
+use crate::create_embed;
+use crate::utils::{Context, Error, EmbedData};
+
+
+/// Display's the connected podman's version information
+#[poise::command(slash_command, prefix_command)]
+pub(super) async fn version(ctx: Context<'_>) -> Result<(), Error> {
+ let version_response = match ctx.data().podman.version().await {
+ Ok(v) => v,
+ Err(e) => {
+ eprintln!("unable too get podman version.");
+ create_embed!(&ctx, "Error", format!("```{}```", e));
+ return Ok(());
+ }
+ };
+
+ create_embed!(&ctx, "Podman Version",
+ "Podman" => format!("v{}",&ctx.data().podman_version),
+ "API" => format!("v{}", match &version_response.api_version {
+ None => { "unknown" }
+ Some(v) => { v }
+ }),
+ "Go" => format!("{}", match &version_response.go_version {
+ None => { "unknown" }
+ Some(v) => { v }
+ }
+ ));
+ Ok(())
+}
+
+/// Podman system info.
+#[poise::command(slash_command, prefix_command)]
+pub(super) async fn system_info(ctx: Context<'_>) -> Result<(), Error> {
+ let info_response = match ctx.data().podman.info().await {
+ Ok(v) => v,
+ Err(e) => {
+ eprintln!("unable too get podman version.");
+ create_embed!(&ctx, "Error", format!("```{}```", e));
+ return Ok(());
+ }
+ };
+
+ let containers_options = ContainerListOpts::builder().all(true).sync(true).build();
+ let containers_response = match ctx
+ .data()
+ .podman
+ .containers()
+ .list(&containers_options)
+ .await
+ {
+ Ok(containers_response) => containers_response,
+ Err(e) => {
+ eprintln!("unable too get podman cache::containers.");
+ create_embed!(&ctx, "Error", format!("```{}```", e));
+ return Ok(());
+ }
+ };
+
+ debug!("{:?}",&info_response);
+ debug!("{:?}",&containers_response);
+
+ let mut running_number = 0;
+ let _ = &containers_response.clone().into_iter().for_each(|c| {
+ if match c.state {
+ None => {
+ false
+ }
+ Some(c) => { c == "running" }
+ } {
+ running_number += 1;
+ }
+ });
+
+ create_embed!(&ctx, "Server info",
+ "Total Containers" => format!("{}", containers_response.len()),
+ "Running Containers" => format!("{}", running_number),
+ "Uptime" => format!("{}", match &info_response.host {
+ None => { "Unknown" }
+ Some(h) => {
+ match &h.uptime {
+ None => { "Unknown" }
+ Some(u) => { u }
+ }
+ }
+ })
+ );
+
+ Ok(())
+}
+
+async fn list_containers(ctx: Context<'_>) -> Result<(), Error> {
+ let info_response = match ctx.data().podman.info().await {
+ Ok(v) => v,
+ Err(e) => {
+ eprintln!("unable too get podman version.");
+ create_embed!(&ctx, "Error", format!("```{}```", e));
+ return Ok(());
+ }
+ };
+
+ let containers_options = ContainerListOpts::builder().all(true).sync(true).build();
+ let containers_response = match ctx
+ .data()
+ .podman
+ .containers()
+ .list(&containers_options)
+ .await
+ {
+ Ok(containers_response) => containers_response,
+ Err(e) => {
+ eprintln!("unable too get podman cache::containers.");
+ create_embed!(&ctx, "Error", format!("```{}```", e));
+ return Ok(());
+ }
+ };
+
+ let mut container_list: Vec<(String, String)> = Vec::new();
+ container_list.reserve(containers_response.len());
+
+
+ todo!()
+}
\ No newline at end of file