Marban
Marban
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Marban on 7/22/2023 in #djs-voice
[ERR_INVALID_ARG_TYPE]
[ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received type number(0)
[ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received type number(0)
The code:
const { AudioPlayerStatus,
createAudioPlayer,
NoSubscriberBehavior,
createAudioResource,
joinVoiceChannel,
StreamType,
createSilence,
} = require("@discordjs/voice");
// ...
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
});
const audioPlayer = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});
connection.subscribe(audioPlayer);
const audioData = [];
audioPlayer.on('data', (chunk) => {
audioData.push(chunk);
});
audioPlayer.on('error', (error) => {
console.error('Error collecting audio data:', error);
connection.destroy();
});
const { AudioPlayerStatus,
createAudioPlayer,
NoSubscriberBehavior,
createAudioResource,
joinVoiceChannel,
StreamType,
createSilence,
} = require("@discordjs/voice");
// ...
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator,
});
const audioPlayer = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});
connection.subscribe(audioPlayer);
const audioData = [];
audioPlayer.on('data', (chunk) => {
audioData.push(chunk);
});
audioPlayer.on('error', (error) => {
console.error('Error collecting audio data:', error);
connection.destroy();
});
Errors as soon as i run the command to create audioPlayer. Discord.JS Version: [email protected] Full Error Stack: https://codeboard.tech/bin/SgGQZj40
2 replies
CDCloudflare Developers
Created by Marban on 7/21/2023 in #pages-help
Wanted to opt-out for edge deploy
Hello, I have a website developed with NextJS 13 (pages dir). I wanted to ignore/opt-out from the edge in some specific paths because it exceeds the limit of 1MB (edge functions need to be under 1MB). And yes it is a dynamic route. I dont want to disable edge for whole website, I still use the edge run time in my API Routes and middleware. Thanks for your response MeowHeartCloudflare
10 replies