diff options
| -rw-r--r-- | discord/gateway.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/discord/gateway.py b/discord/gateway.py index 21f4fc66..13ea85b7 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -721,9 +721,7 @@ class DiscordVoiceWebSocket(websockets.client.WebSocketClientProtocol): ip_end = recv.index(0, ip_start) state.ip = recv[ip_start:ip_end].decode('ascii') - # the port is a little endian unsigned short in the last two bytes - # yes, this is different endianness from everything else - state.port = struct.unpack_from('<H', recv, len(recv) - 2)[0] + state.port = struct.unpack_from('>H', recv, len(recv) - 2)[0] log.debug('detected ip: %s port: %s', state.ip, state.port) # there *should* always be at least one supported mode (xsalsa20_poly1305) |