more commands incoming

This commit is contained in:
2024-02-13 23:00:54 +01:00
parent 8fa86b0182
commit 639fd7775f
24 changed files with 127 additions and 48 deletions

View File

@@ -0,0 +1,23 @@
use std::time::SystemTime;
use poise::CreateReply;
use crate::{commands::embeds::embed, Context, Error};
/// Prints current time in POSIX format
#[poise::command(
prefix_command,
slash_command,
category = "Tools"
)]
pub async fn posix(
ctx: Context<'_>
) -> Result<(), Error> {
let time = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis();
ctx.send(
CreateReply::default().embed(embed(ctx, "The time is", &format!("{} ms", time), "since Jan 1st 1970").await.unwrap())
).await?;
Ok(())
}