mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 12:26:10 +01:00
minor refractors, uptime removed
This commit is contained in:
@@ -28,6 +28,5 @@ pub use resume::resume;
|
||||
pub use seek::seek;
|
||||
pub use shuffle::shuffle;
|
||||
pub use skip::skip;
|
||||
pub use soundboard::soundboard;
|
||||
pub use stop::stop;
|
||||
pub use volume::volume;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
use crate::{commands::embeds::embed, Context, Error};
|
||||
use poise::CreateReply;
|
||||
pub mod effect;
|
||||
pub mod stream;
|
||||
|
||||
/// A better soundboard
|
||||
#[poise::command(prefix_command, slash_command, category = "Music")]
|
||||
pub async fn soundboard(ctx: Context<'_>) -> Result<(), Error> {
|
||||
ctx.send(CreateReply::default().embed(embed(ctx, "", "", "").await.unwrap()))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
pub use effect::effect;
|
||||
pub use stream::stream;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
use crate::{commands::embeds::embed, Context, Error};
|
||||
use poise::CreateReply;
|
||||
|
||||
/// Plays one of available audio effects
|
||||
#[poise::command(prefix_command, slash_command, category = "Music")]
|
||||
pub async fn effect(ctx: Context<'_>) -> Result<(), Error> {
|
||||
ctx.send(CreateReply::default().embed(embed(ctx, "Playing an effect", "", "").await.unwrap()))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
11
src/commands/music/soundboard/stream.rs
Normal file
11
src/commands/music/soundboard/stream.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use crate::{commands::embeds::embed, Context, Error};
|
||||
use poise::CreateReply;
|
||||
|
||||
/// Hijacks current audio output and plays selected audio
|
||||
#[poise::command(prefix_command, slash_command, aliases("override"), category = "Music")]
|
||||
pub async fn stream(ctx: Context<'_>) -> Result<(), Error> {
|
||||
ctx.send(CreateReply::default().embed(embed(ctx, "Playing audio", "", "").await.unwrap()))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -10,7 +10,7 @@ pub mod posix;
|
||||
pub mod qr;
|
||||
pub mod register;
|
||||
pub mod taf;
|
||||
pub mod uptime;
|
||||
// pub mod uptime;
|
||||
pub mod verse;
|
||||
pub mod weather;
|
||||
|
||||
@@ -26,6 +26,6 @@ pub use posix::posix;
|
||||
pub use qr::qr;
|
||||
pub use register::register;
|
||||
pub use taf::taf;
|
||||
pub use uptime::uptime;
|
||||
// pub use uptime::uptime;
|
||||
pub use verse::verse;
|
||||
pub use weather::weather;
|
||||
|
||||
@@ -2,11 +2,34 @@ use poise::CreateReply;
|
||||
|
||||
use crate::{commands::embeds::embed, Context, Error};
|
||||
|
||||
// Currently unable to get information on how long the thread was running.
|
||||
const PROCESS_UPTIME: i64 = 1000;
|
||||
|
||||
/// Checks how long the bot has been running
|
||||
#[poise::command(prefix_command, slash_command, category = "Tools")]
|
||||
pub async fn uptime(ctx: Context<'_>) -> Result<(), Error> {
|
||||
ctx.send(CreateReply::default().embed(embed(ctx, "", "", "").await.unwrap()))
|
||||
.await?;
|
||||
let uptime = PROCESS_UPTIME;
|
||||
let days = uptime / (24 * 60 * 60);
|
||||
let hours = (uptime % (24 * 60 * 60)) / 3600;
|
||||
let minutes = (uptime % 60 * 60) / 60;
|
||||
let seconds = uptime % 60;
|
||||
|
||||
ctx.send(
|
||||
CreateReply::default().embed(
|
||||
embed(
|
||||
ctx,
|
||||
"I have been up and awake for",
|
||||
&format!("{} seconds", uptime),
|
||||
&format!(
|
||||
"{} days, {} hours, {} minutes and {} seconds",
|
||||
days, hours, minutes, seconds
|
||||
),
|
||||
)
|
||||
.await
|
||||
.unwrap(),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user