code cleanup and play command polish

This commit is contained in:
2024-02-12 22:27:14 +01:00
parent a27e95a88d
commit 3b0121699f
9 changed files with 166 additions and 33 deletions

View File

@@ -0,0 +1,12 @@
use crate::{Context, Error};
#[poise::command(prefix_command, check = "check")]
pub async fn register(ctx: Context<'_>) -> Result<(), Error> {
poise::builtins::register_application_commands_buttons(ctx).await?;
Ok(())
}
async fn check(ctx: Context<'_>) -> Result<bool, Error> {
let owner = std::env::var("OWNER_ID").expect("Environment variable `OWNER_ID` not found");
Ok(ctx.author().id.to_string() == owner)
}