我有这个机器人代码"discord.js v13",我需要获得附加文件的网址并立即发送链接。我该怎么做?我将把代码部分留在下面
// save file in folder 'musicas'
stream.pipe(createWriteStream(__dirname + `/musicas/${pegaid}.mp3`)).on('finish', () => {
// Sending the attachment, and its link
try {
message.channel.send({
files: [{
attachment: (__dirname + `/musicas/${musicid}.mp3`),
name: `${musicid}.mp3`
}],
});
} catch (e) {
return message.channel.send(`${message.author}, Error ao tentar converter a música!`);
}发布于 2022-04-04 11:41:07
我猜你想发送附加文件的URL。不幸的是,您只能在首先发送附件本身之后发送URL。
const image = await message.channel.send({ files: [{ attachment: `full-path`, name: `something.mp3` }] });
return message.channel.send({ content: `${image.attachments.first().proxyURL}` });在discord.js文档这里中阅读更多关于它的信息。
https://stackoverflow.com/questions/71730727
复制相似问题