0.5.0 embed, help, refractor

This commit is contained in:
2024-02-13 18:44:01 +01:00
parent d75c5bc9a2
commit 8fa86b0182
24 changed files with 341 additions and 94 deletions

View File

@@ -1,12 +1,13 @@
use crate::{Context, Error};
#[poise::command(prefix_command, check = "check")]
pub async fn register(ctx: Context<'_>) -> Result<(), Error> {
#[poise::command(
prefix_command,
hide_in_help,
owners_only
)]
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)
}