From 82a179fce8bb0c34b669df94702809f4d90c64ff Mon Sep 17 00:00:00 2001 From: Priyanshu Verma Date: Mon, 29 Jan 2024 11:58:39 +0530 Subject: [PATCH] [feat] Make commands with sensitive info ephemeral --- bot/src/commands/attendance.rs | 2 +- bot/src/commands/courses.rs | 2 +- bot/src/commands/profile.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/src/commands/attendance.rs b/bot/src/commands/attendance.rs index 79b5b32..b09aac7 100644 --- a/bot/src/commands/attendance.rs +++ b/bot/src/commands/attendance.rs @@ -13,7 +13,7 @@ Note: This command requires you to be logged in using the /login command. If you /// Retrieves your attendance records for the current semester. #[poise::command(prefix_command, slash_command, help_text_fn = "attendance_help")] pub async fn attendance(ctx: Context<'_>) -> CommandResult { - ctx.defer().await?; + ctx.defer_ephemeral().await?; let mut invocation_data = ctx.invocation_data::>().await.unwrap(); let client = invocation_data.as_mut()?; diff --git a/bot/src/commands/courses.rs b/bot/src/commands/courses.rs index 994c816..a5425a2 100644 --- a/bot/src/commands/courses.rs +++ b/bot/src/commands/courses.rs @@ -24,7 +24,7 @@ pub async fn courses( ctx: Context<'_>, #[description = "Semester number"] semester: Option, ) -> CommandResult { - ctx.defer().await?; + ctx.defer_ephemeral().await?; let mut invocation_data = ctx.invocation_data::>().await.unwrap(); let client = invocation_data.as_mut()?; diff --git a/bot/src/commands/profile.rs b/bot/src/commands/profile.rs index 5d956aa..4b74f17 100644 --- a/bot/src/commands/profile.rs +++ b/bot/src/commands/profile.rs @@ -11,7 +11,7 @@ The information is presented in an embedded format with different fields."; /// Retrieve and display your user profile information. #[poise::command(prefix_command, slash_command, help_text_fn = "profile_help")] pub async fn profile(ctx: Context<'_>) -> CommandResult { - ctx.defer().await?; + ctx.defer_ephemeral().await?; let mut invocation_data = ctx.invocation_data::>().await.unwrap(); let client = invocation_data.as_mut()?;