Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4001 Unknown Opcode after voicechannel disconnect #243

Open
Sukadia opened this issue May 23, 2020 · 2 comments
Open

4001 Unknown Opcode after voicechannel disconnect #243

Sukadia opened this issue May 23, 2020 · 2 comments
Labels

Comments

@Sukadia
Copy link

Sukadia commented May 23, 2020

Capture

I'm getting an issue where whenever I run voiceconnection:close() or voicechannel:leave() I receive an invalid opcode warning and a subsequent disconnect/reconnect from discord. I'm running version 2.8.3.

Here's the selection of code that runs the above output:

local voiceconnection = SpeakChannel:join()
local connected = true
local function abort(member,channel)
    if connected and channel == SpeakChannel and not member.user.bot then
        connected = false
        print("Player left")
        voiceconnection:close()
    end
end
client:on("voiceChannelLeave",abort)
local songnum = 1
for i = #songs, 2, -1 do
    local j = math.random(i)
    songs[i], songs[j] = songs[j], songs[i]
end
while connected do
    print("Song loop start")
    if songs[songnum] == nil then
        songnum = 1
    end
    local songinfo = songs[songnum]
    print("Song playing")
    local s, e = voiceconnection:playFFmpeg("music/"..songinfo["filename"]..".mp3")
    print(e)
    print("Song loop end")
    songnum = songnum + 1
end
@SinisterRectus
Copy link
Owner

Sorry for the lack of reply. I honestly have no idea what this issue can be. The voice gateway connection should have nothing to do with the main connection. Is this still an issue for you?

@Sukadia
Copy link
Author

Sukadia commented Aug 3, 2020

It is, but I've opted for a bot that doesn't leave the voice channel so I don't have to worry about it happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants