spam reduction & config command
This commit is contained in:
+6
-1
@@ -33,7 +33,7 @@ pub async fn stop(
|
||||
let should_stop = ctx.data().args.dev
|
||||
|| confirmation.unwrap_or_else(|| "".to_string()).to_lowercase() == "i want to stop the bot now";
|
||||
|
||||
let is_creator = ctx.author().id == UserId::new(ctx.data().byte_dice_id);
|
||||
let is_creator = is_creator(ctx);
|
||||
|
||||
if should_stop && is_creator {
|
||||
let msg = send_msg(ctx, "Saving data...".to_string(), true, true).await.unwrap();
|
||||
@@ -58,6 +58,11 @@ pub async fn stop(
|
||||
}
|
||||
|
||||
|
||||
pub fn is_creator(ctx: Context<'_>) -> bool {
|
||||
return ctx.author().id == UserId::new(ctx.data().byte_dice_id);
|
||||
}
|
||||
|
||||
|
||||
#[poise::command(
|
||||
slash_command,
|
||||
prefix_command,
|
||||
|
||||
Reference in New Issue
Block a user