TypeError: Cannot create property 'audioPlayer' on string 'study'

Hello so I noticed something my bot crashes after a while because of the module. I'd like to know how to prevent it from crashing.
C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112
resource.audioPlayer = this;
^

TypeError: Cannot create property 'audioPlayer' on string 'study'
at AudioPlayer.play (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112:26)
at AudioPlayer.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\events\client\ready.js:74:33)
at AudioPlayer.emit (node:events:513:28)
at set state [as state] (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1083:12)
at AudioPlayer.checkPlayable (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1224:18)
at C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:60
at Array.filter (<anonymous>)
at audioCycleStep (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:34)
at Timeout.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:137:45)
at listOnTimeout (node:internal/timers:569:17)

Node.js v18.16.0
C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112
resource.audioPlayer = this;
^

TypeError: Cannot create property 'audioPlayer' on string 'study'
at AudioPlayer.play (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112:26)
at AudioPlayer.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\events\client\ready.js:74:33)
at AudioPlayer.emit (node:events:513:28)
at set state [as state] (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1083:12)
at AudioPlayer.checkPlayable (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1224:18)
at C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:60
at Array.filter (<anonymous>)
at audioCycleStep (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:34)
at Timeout.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:137:45)
at listOnTimeout (node:internal/timers:569:17)

Node.js v18.16.0
`
5 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
t3mq
t3mqOP2y ago
TypeError: Cannot create property 'audioPlayer' on string 'boy'
at AudioPlayer.play (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112:26)
at AudioPlayer.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\events\client\ready.js:74:33)
at AudioPlayer.emit (node:events:513:28)
at set state [as state] (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1083:12)
at AudioPlayer.checkPlayable (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1224:18)
at C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:60
at Array.filter (<anonymous>)
at audioCycleStep (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:34)
at Timeout.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:137:45)
at listOnTimeout (node:internal/timers:569:17)

Node.js v18.16.0
TypeError: Cannot create property 'audioPlayer' on string 'boy'
at AudioPlayer.play (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1112:26)
at AudioPlayer.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\events\client\ready.js:74:33)
at AudioPlayer.emit (node:events:513:28)
at set state [as state] (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1083:12)
at AudioPlayer.checkPlayable (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:1224:18)
at C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:60
at Array.filter (<anonymous>)
at audioCycleStep (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:126:34)
at Timeout.<anonymous> (C:\Users\xiaotox.fr\Documents\GitHub\SoundCord\node_modules\@discordjs\voice\dist\index.js:137:45)
at listOnTimeout (node:internal/timers:569:17)

Node.js v18.16.0
yes i use AudioResource
let resource = createAudioResource(audioStream.stream, {
inputType: audioStream.type,
inlineVolume: true
});
let resource = createAudioResource(audioStream.stream, {
inputType: audioStream.type,
inlineVolume: true
});
le audioStream
let audioStream = await playdl.stream(RadioMap.get(db.radio));
let audioStream = await playdl.stream(RadioMap.get(db.radio));
how can I understand you if I can't understand your sentences?

audioPlayer.play(db.radio);

audioPlayer.play(db.radio);
this ? I use db.radio as a string in my db. to explain quickly when the user does /station he clicks on a radio in the select menu I record the value in db as a String and in the ready when the bot reconnects in voice it will look for the value and take the link from the map. how do I do it then because I pass him my AudioRessource it's in the audio resource that I pass the db.Radio If you don't explain how I should do it, how do you want me to understand how to do it?
d.js docs
d.js docs2y ago
method AudioPlayer#play() Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed (it cannot be reused, even in another player) and is replaced with the new resource.
t3mq
t3mqOP2y ago
except that I give it a parameter, not a String but I don't see where this famous character string is, because the AudioRessource I pass to it is audioStream except that I've shown you my audioRessource and the audioPlayer I'm passing him my audioRessource I had modified after yesterday, but today the error persists. i have replace db.radio with ressource
Nounejm
Nounejm2y ago
- const connection = joinVoiceChannel(...) - const { player } = connection.subscribe(createAudioPlayer(...)) - player.play(createAudioResource(...)) to me, it looks like he doesnt know where to pass what
Want results from more Discord servers?
Add your server