added a WhoAmI command

This commit is contained in:
2025-07-12 12:04:53 +02:00
parent aad562cb2d
commit 358b16249e
6 changed files with 34 additions and 13 deletions
+4 -4
View File
@@ -8,8 +8,8 @@ use crate::{lang, messages::send_msg, Context, Cmd, Error};
enum HelpOptions {
Admin,
All,
BkWeek,
BkWeekReddit,
Reddit,
RedditBot,
Generic
}
@@ -97,8 +97,8 @@ async fn send_single_help(ctx: Context<'_>, mut cmd_name: String) {
async fn send_category_help(ctx: Context<'_>, category: HelpOptions) {
match category {
HelpOptions::BkWeekReddit => send_bk_week_help_re(ctx).await,
HelpOptions::BkWeek => send_bk_week_help (ctx).await,
HelpOptions::RedditBot => send_bk_week_help_re(ctx).await,
HelpOptions::Reddit => send_bk_week_help (ctx).await,
HelpOptions::Generic => send_generic_help (ctx).await,
HelpOptions::Admin => send_admin_help (ctx).await,
HelpOptions::All => send_all_help (ctx).await
+20
View File
@@ -0,0 +1,20 @@
use crate::{lang, messages::send_msg, Context, Error};
#[poise::command(
slash_command,
prefix_command,
rename = "whoami",
category = "help",
required_bot_permissions = "SEND_MESSAGES | VIEW_CHANNEL"
)]
pub async fn cmd(ctx: Context<'_>) -> Result<(), Error> {
let data = ctx.data();
let uid: u64 = ctx.author().id.into();
let is_owner = data.owners .contains(&uid);
let is_bk_mod = data.bk_mods.contains(&uid);
send_msg(ctx, lang!("dc_msg_whoami", is_owner, is_bk_mod), true, true).await;
return Ok(());
}