Closed abokado0107 closed 1 year ago
This is fixed by #170, though the final solution will be a bit different than the current pr.
I received a similar error in one of my bug reports.
For my case, it produced 2 different error messages.
let (_handle_lock, success) = manager.join(guild_id, connect_to).await;
let reply = match dbg!(success) {
Ok(_) => format!("Joined {}", connect_to.mention()),
Err(e) =>format!("Failed to join voice channel: {:?}", e),
};
The bot replies with:
Failed to join voice channel: Driver(Ws(WsClosed(Some(CloseFrame { code: Library(4006), reason: "Session is no longer valid." }))))
If the voice state is changed (forced by switching bot between VC channels), I was then prompted with the same error as this issue. Prompted on the same code block as above.
Failed to join voice channel: Driver(Ws(Json(Error("invalid value: integer 18, expected opcode in [0--9] + [12--13]", line: 1, column: 8))))
I can confirm similar behavior as above, bot is able to join VC-channel, but unable to emit audio
I also have this issue. I'm using songbird-py so the error message is slightly different, but definitely seems like the same issue.
Also having a similar issue via songbird-py . Connects but won't play anything and throws this trace:
Traceback (most recent call last):
File "/home/pi/DiscordBots/RB/bot/extensions/shortcuts.py", line 402, in countdown_timer
voice = await Voicebox.connect(bot, guild_id, user_voice_channel_id)
File "/home/pi/.local/lib/python3.9/site-packages/songbird/hikari.py", line 19, in connect
return await client.voice.connect_to(
File "/home/pi/.local/lib/python3.9/site-packages/hikari/impl/voice.py", line 209, in connect_to
voice_connection = await voice_connection_type.initialize(
File "/home/pi/.local/lib/python3.9/site-packages/songbird/hikari.py", line 40, in initialize
await driver.connect(
module.CouldNotConnectToRTPError: Ws(WsClosed(Some(CloseFrame { code: Library(4006), reason: "Session is no longer valid." })))
The contributor worked around this problem. If you are using Cargo.toml to manage your crate, please change the contents of songbird as follows:
[dependencies.songbird]
features = ["builtin-queue"]
git = "https://github.com/Erk-/songbird/"
branch = "do-not-fail-if-new-opcode"
Note, however, that this is not an official serenity crate. This is a temporary solution, and once this branch is merged into serenity, you should use the official one. And perhaps in a little while this branch will be merged into serenity.
Songbird 0.3.2 has been released with the fix to this issue https://github.com/serenity-rs/songbird/releases/tag/v0.3.2
I think this issue can be closed?
Sure, closed by #170.
I don't know if 'error 1' is the same issue or some weird knock-on -- if this persists on v0.3.2, please reopen. This should be ported to next once I have access to a computer again.
Songbird version: (version) 0.3.0
Rust version (
rustc -V
): (version) rustc 1.65.0 (897e37553 2022-11-02)Serenity/Twilight version: (version) Serenity 0.11.5
Output of
ffmpeg -version
,yt-dlp --version
(if relevant): ffmpeg version 4.2.4-1ubuntu0.1Description: Our application can no longer connect to the voice channel. To be more precise, it connects, but we can no longer speak.
From the log above, it is possible that something called
opcode 18
is being sent and it is no longer working properly.Steps to reproduce:
Songbird sample code doesn't work.
https://github.com/serenity-rs/songbird/blob/current/examples/serenity/voice/src/main.rs
Work: Connect to VC normally.