mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 20:36:10 +01:00
0.5.1 refractor
This commit is contained in:
@@ -5,19 +5,26 @@ 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();
|
||||
#[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?;
|
||||
CreateReply::default().embed(
|
||||
embed(
|
||||
ctx,
|
||||
"The time is",
|
||||
"since Jan 1st 1970",
|
||||
&format!("{} ms", time),
|
||||
)
|
||||
.await
|
||||
.unwrap(),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user