added a WhoAmI command
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
@@ -79,6 +79,7 @@ async fn make_cmd_vec(data: &Data) -> Vec<Cmd> {
|
||||
let mut cmds = vec![
|
||||
// GENERIC
|
||||
cmds::help::cmd(),
|
||||
cmds::whoami::cmd(),
|
||||
cmds::ping::cmd(),
|
||||
cmds::eight_ball::cmd(),
|
||||
// REDDIT
|
||||
|
||||
@@ -10,6 +10,7 @@ mod cmds {
|
||||
pub mod reload_cfg;
|
||||
pub mod send;
|
||||
pub mod stop;
|
||||
pub mod whoami;
|
||||
}
|
||||
mod re_cmds {
|
||||
pub mod add;
|
||||
|
||||
Reference in New Issue
Block a user