【发布时间】:2021-10-22 03:39:52
【问题描述】:
Discord.js 发布了 v13,我正在尝试更新我的小自制 discordbot。
我遇到了一个问题,我无法再通过 Web URL 发送附件 (png)。
Discord.js v12
var testchart = `http://jegin.net/testchart2.php?sysid=268.png`;
message.channel.send("Last updated " + updatedAt.fromNow(), {
files: [{
attachment: testchart,
name: 'file.png'
}]
并且机器人不返回图像:
我试过了:
message.channel.send("Last updated " + updatedAt.fromNow(), {
files: [testchart]
和
message.channel.send("Last updated " + updatedAt.fromNow(), {
files: Array.from(testchart)
});
最后
message.channel.send({
files: [testchart],
content: `Last updated ${updatedAt.fromNow()}`
});
感谢您的帮助!
Discord.js 更新指南:https://discordjs.guide/additional-info/changes-in-v13.html#sending-messages-embeds-files-etc
我能找到关于此事的唯一其他问题:Discord.js V13 sending message attachments
【问题讨论】:
-
在左下角你可以看到
testchart2.php
标签: file url discord discord.js attachment