Skip to content

Commit

Permalink
[feat] Make commands with sensitive info ephemeral
Browse files Browse the repository at this point in the history
  • Loading branch information
Blonteractor committed Jan 29, 2024
1 parent 5c3984a commit 82a179f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bot/src/commands/attendance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Result<UserClient>>().await.unwrap();

let client = invocation_data.as_mut()?;
Expand Down
2 changes: 1 addition & 1 deletion bot/src/commands/courses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub async fn courses(
ctx: Context<'_>,
#[description = "Semester number"] semester: Option<usize>,
) -> CommandResult {
ctx.defer().await?;
ctx.defer_ephemeral().await?;
let mut invocation_data = ctx.invocation_data::<Result<UserClient>>().await.unwrap();

let client = invocation_data.as_mut()?;
Expand Down
2 changes: 1 addition & 1 deletion bot/src/commands/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Result<UserClient>>().await.unwrap();

let client = invocation_data.as_mut()?;
Expand Down

0 comments on commit 82a179f

Please sign in to comment.