add version command

This commit is contained in:
2025-02-17 17:35:37 -05:00
parent d3778461d8
commit 8ea2bcb2e2
3 changed files with 25 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ mod gambling;
mod eval;
pub mod self_roles;
mod settings;
mod version;
use crate::common::{Data, Error, Context};
@@ -35,5 +36,6 @@ pub fn commands() -> Vec<Command<Data, Error>> {
eval::eval(),
self_roles::role(),
settings::setting(),
version::version(),
]
}

8
src/commands/version.rs Normal file
View File

@@ -0,0 +1,8 @@
use crate::common::{Context, Error};
/// Tells you the current version of BigBirb
#[poise::command(slash_command, prefix_command)]
pub async fn version(ctx: Context<'_>) -> Result<(), Error> {
ctx.reply(format!("version {} ({}/{})", env!("CARGO_PKG_VERSION"), env!("GIT_BRANCH"), env!("GIT_HASH"))).await?;
Ok(())
}