diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:09:53 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:09:53 +0100 |
| commit | 76c1824bd6f0dcb157544862652b65af8f6539ce (patch) | |
| tree | 1b89a5394d2cfb207d3fe37ae6d40d4a86dfd04a /src/commands | |
| parent | triggers: scope groups to the guild that created them (diff) | |
| download | senator-sperma-76c1824bd6f0dcb157544862652b65af8f6539ce.tar.gz senator-sperma-76c1824bd6f0dcb157544862652b65af8f6539ce.zip | |
recording: keep one buffer per guild
Diffstat (limited to '')
| -rw-r--r-- | src/commands/record.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/record.rs b/src/commands/record.rs index 48cbc59..dfe736d 100644 --- a/src/commands/record.rs +++ b/src/commands/record.rs | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | use poise::serenity_prelude as serenity; | ||
| 1 | use tracing::warn; | 2 | use tracing::warn; |
| 2 | 3 | ||
| 3 | use crate::error::Result; | 4 | use crate::error::Result; |
| @@ -52,14 +53,14 @@ pub async fn record(ctx: Context<'_>) -> Result<()> { | |||
| 52 | ctx.say(lang::L_RECORD_NOT_SAME_VC).await?; | 53 | ctx.say(lang::L_RECORD_NOT_SAME_VC).await?; |
| 53 | Ok(()) | 54 | Ok(()) |
| 54 | } | 55 | } |
| 55 | Some(_) => record_impl(ctx).await, | 56 | Some(_) => record_impl(ctx, guild_id).await, |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | async fn record_impl(ctx: Context<'_>) -> Result<()> { | 60 | async fn record_impl(ctx: Context<'_>, guild_id: serenity::GuildId) -> Result<()> { |
| 60 | let data = ctx.data(); | 61 | let data = ctx.data(); |
| 61 | 62 | ||
| 62 | let Some(rec) = data.voice_manager.get_recorder().await else { | 63 | let Some(rec) = data.voice_manager.get_recorder(guild_id).await else { |
| 63 | ctx.say(lang::L_RECORD_NOT_RECORDING).await?; | 64 | ctx.say(lang::L_RECORD_NOT_RECORDING).await?; |
| 64 | return Ok(()); | 65 | return Ok(()); |
| 65 | }; | 66 | }; |
