minor change

This commit is contained in:
Stachelbeere1248 2024-12-15 21:45:35 +01:00
parent d6578d4ffe
commit 19befad93c
Signed by: Stachelbeere1248
SSH key fingerprint: SHA256:IozEKdw2dB8TZxkpPdMxcWSoWTIMwoLaCcZJ1AJnY2o

View file

@ -137,7 +137,7 @@ pub(crate) async fn add<'a>(
#[description = "Discord User"] user: Option<User>, #[description = "Discord User"] user: Option<User>,
#[description = "admin-only"] force: Option<bool>, #[description = "admin-only"] force: Option<bool>,
) -> Result<(), Error> { ) -> Result<(), Error> {
ctx.defer_ephemeral().await?; ctx.defer().await?;
let user: User = user.unwrap_or(ctx.author().clone()); let user: User = user.unwrap_or(ctx.author().clone());
let uuid: Uuid = Uuid::for_ign(ign.as_str()).await?; let uuid: Uuid = Uuid::for_ign(ign.as_str()).await?;
let force: bool = force.unwrap_or(false) && ctx.framework().options.owners.contains(&ctx.author().id); let force: bool = force.unwrap_or(false) && ctx.framework().options.owners.contains(&ctx.author().id);
@ -233,12 +233,12 @@ pub(crate) async fn add<'a>(
ephemeral = "false", ephemeral = "false",
)] )]
pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Error> { pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Error> {
ctx.defer_ephemeral().await?; ctx.defer().await?;
cooldown(&ctx, 600, 300)?; cooldown(&ctx, 600, 300)?;
let user: User = user.unwrap_or(ctx.author().clone()); let user: User = user.unwrap_or(ctx.author().clone());
let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool; let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool;
let s: String = list_string(pool, &user).await?; let s: String = list_string(pool, &user).await?;
let r: CreateReply = CreateReply::default().ephemeral(false); let r: CreateReply = CreateReply::default();
ctx.send( ctx.send(
r.content(s) r.content(s)
.allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()), .allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()),
@ -251,11 +251,11 @@ pub(crate) async fn list(ctx: Context<'_>, user: Option<User>) -> Result<(), Err
slash_command, slash_command,
install_context = "User|Guild", install_context = "User|Guild",
interaction_context = "Guild|PrivateChannel", interaction_context = "Guild|PrivateChannel",
ephemeral = "false", ephemeral = "true",
context_menu_command="Account list" context_menu_command="Account list"
)] )]
pub(crate) async fn context_list(ctx: Context<'_>, u: User) -> Result<(), Error> { pub(crate) async fn context_list(ctx: Context<'_>, u: User) -> Result<(), Error> {
ctx.defer_ephemeral().await?; ctx.defer().await?;
cooldown(&ctx, 600, 300)?; cooldown(&ctx, 600, 300)?;
let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool; let pool: &Pool<Sqlite> = &ctx.data().sqlite_pool;
let s: String = list_string(pool, &u).await?; let s: String = list_string(pool, &u).await?;
@ -263,7 +263,6 @@ pub(crate) async fn context_list(ctx: Context<'_>, u: User) -> Result<(), Error>
CreateReply::default() CreateReply::default()
.content(s) .content(s)
.allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users()) .allowed_mentions(CreateAllowedMentions::new().empty_roles().empty_users())
.ephemeral(true)
).await?; ).await?;
Ok(()) Ok(())
} }