Skip to content

Exception thrown when attempting to get VoiceState channel #1558

Open
@dank074

Description

@dank074

Which package has the bugs?

The core library

Issue description

Steps to reproduce:

  1. Do not join any voice channel
  2. call the following snippet
  3. The following exception gets thrown:
node:events:496
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at get channel (\discord-tests\self-bot\node_modules\discord.js-selfbot-v13\src\structures\VoiceState.js:155:49)

Code sample

const channel = client.user?.voice?.channel;

Package version

3.6.1

Node.js version

v22.10.0

Operating system

windows

Priority this issue should have

Low (slightly annoying)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions