Skip to content

Commit

Permalink
fix(Voice): only skip undocumented voice packet byte if present (#5309)
Browse files Browse the repository at this point in the history
* fix(Voice*): Only skip undocumented byte if present

* fix linting errors
  • Loading branch information
decahedron1 committed Apr 5, 2021
1 parent 67025e6 commit 2b52cdc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/voice/receiver/PacketHandler.js
Expand Up @@ -72,8 +72,9 @@ class PacketHandler extends EventEmitter {
if (byte === 0) continue;
offset += 1 + (0b1111 & (byte >> 4));
}
// Skip over undocumented Discord byte
offset++;
// Skip over undocumented Discord byte (if present)
const byte = packet.readUInt8(offset);
if (byte === 0x00 || byte === 0x02) offset++;

packet = packet.slice(offset);
}
Expand Down

0 comments on commit 2b52cdc

Please sign in to comment.