TypeError
I am currently on a discord music bot which has a 247 command and for some reason the bot just times out after few hours, so I am trying to code so that if by chance the bot does leave or gets disconnet it will attempt to rejoin the voice chat, but I am running to a TypeError: realVoiceChannel.join is not a function;
10 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!pretty sure voicechannel#join doesnt exist
is there a alt way, I could make my bot attempt a rejoin?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Thats 2 different ways, making it join and reconnect itself.
to my understanding the only platform that will be against the TOS is youtube. but thanks for the heads up.
well I've tried that but no it doesn't work.
using the code for the join command, its weird because when I use the dc command its able to rejoin the vc but when I manually disconnect it from vc it is unable to join back saying ID is not found (log), but I did more debugging and the ID the bot pulls from the DB is the same.
also DiscordAPIError[10008]: Unknown Message
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async MessageManager.delete (/home/container/node_modules/discord.js/src/managers/MessageManager.js:255:5)
at async Message.delete (/home/container/node_modules/discord.js/src/structures/Message.js:816:5) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Unknown Message', code: 10008 },
code: 10008,
status: 404,
method: 'DELETE',
url: 'https://discord.com/api/v10/channels/958143858280112191/messages/1148672688961888337'
}
I don't understand why I keep thing this API error, I have the bot's perm, the message ID which the bot is trying to delete and such.
Log after disconnect the bot manually
You can see the ID pulled from DB is the same as the voice channel ID that logs no such ID found
are you using discord.js v13 or v14
Version 14 has released! Please update at your earliest convenience.
- Update:
npm rm discord.js
npm i discord.js
- Update guide (use CTRL
+ F
to search for the old method or property) is it that causing the bot not to join?