Discordの音楽再生コマンドを見様見真似で作っていたのですが、
DiscordAPIError: Cannot send an empty message
というエラーが出てコマンドが実行できません。
コマンド↓
if(command === "test" || command === "ts"){
try{
const connection = await message.member.voice.channel.join();
connection.play(ytdl("https://www.youtube.com/watch?v=L6qBZPt3lck", {
filter: 'audioonly'
}))
}catch(error){
message.channel.send(error)
return;
}
}
エラー全文
RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^
DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (C:\Users\i3 550\desktop\Soft\akikaki\agile-island-80543\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async RequestHandler.push (C:\Users\i3 550\desktop\Soft\akikaki\agile-island-80543\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
method: 'post',
path: '/channels/863359143267139594/messages',
code: 50006,
httpStatus: 400
}