fix voice move state bug

This commit is contained in:
mii443
2025-04-03 03:03:06 +09:00
parent cff30e7471
commit e12dbd7375
2 changed files with 5 additions and 7 deletions

View File

@ -14,6 +14,6 @@ RUN cargo build --release
FROM ubuntu:22.04 AS runtime
WORKDIR /ncb-tts-r2
RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates ffmpeg libssl-dev libopus-dev && apt-get -y clean && mkdir audio
RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates ffmpeg libssl-dev libopus-dev && apt-get -y clean
COPY --from=builder /app/target/release/ncb-tts-r2 /usr/local/bin
ENTRYPOINT ["/usr/local/bin/ncb-tts-r2"]

View File

@ -29,12 +29,10 @@ impl VoiceMoveStateTrait for VoiceState {
(Some(old_channel_id), Some(new_channel_id)) => {
if old_channel_id == new_channel_id {
VoiceMoveState::NONE
} else if old_channel_id != new_channel_id {
if target_channel == new_channel_id {
VoiceMoveState::JOIN
} else {
VoiceMoveState::NONE
}
} else if old_channel_id == target_channel {
VoiceMoveState::LEAVE
} else if new_channel_id == target_channel {
VoiceMoveState::JOIN
} else {
VoiceMoveState::NONE
}