diff --git a/src/main.rs b/src/main.rs index 21cbf03..6c5ac92 100644 --- a/src/main.rs +++ b/src/main.rs @@ -179,7 +179,11 @@ async fn dawn(ctx: Context<'_>) -> Result<()> { } #[poise::command(slash_command, ephemeral)] -async fn join(ctx: Context<'_>, to: serenity::UserId, user: Option) -> Result<()> { +async fn join( + ctx: Context<'_>, + to: serenity::UserId, + user: Option, +) -> Result<()> { let guild = ctx .guild_id() .ok_or_eyre("This bot only works in servers")?; @@ -195,7 +199,9 @@ async fn join(ctx: Context<'_>, to: serenity::UserId, user: Option { - guild.move_member(ctx, user.unwrap_or(ctx.author().id), channel).await?; + guild + .move_member(ctx, user.unwrap_or(ctx.author().id), channel) + .await?; ctx.reply("Joined player").await?; } None => { @@ -213,6 +219,8 @@ async fn st(ctx: Context<'_>, mut spectators: Vec) -> Result<( let GuildData { st, .. } = ctx.data().get(guild).await?; spectators.push(ctx.author().id); + ctx.defer_ephemeral().await?; + guild .members_iter(&ctx) .try_for_each(|member| { @@ -313,7 +321,14 @@ async fn main() -> Result<()> { let framework = poise::Framework::builder() .options(poise::FrameworkOptions { - commands: vec![dusk(), dawn(), st(), currently_playing(), join(), configure()], + commands: vec![ + dusk(), + dawn(), + st(), + currently_playing(), + join(), + configure(), + ], event_handler: |ctx, ev, ctxf, data| on_event(ctx, ev, ctxf, data).boxed(), ..Default::default() })