Discord.js released v13 and I'm trying to update my little homebrew discordbot.
I've come across an issue where I can no longer send an attached file (png) via a web URL.
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'
}]
No errors to the console are made (other than a depreciation warning):
And the bot does not return an image:
I've tried:
message.channel.send("Last updated " + updatedAt.fromNow(), {
files: [testchart]
and
message.channel.send("Last updated " + updatedAt.fromNow(), {
files: Array.from(testchart)
});
And finally
message.channel.send({
files: [testchart],
content: `Last updated ${updatedAt.fromNow()}`
});
Which gives me this AWFUL output:
Thanks for the help!
Discord.js's guide for updates: https://discordjs.guide/additional-info/changes-in-v13.html#sending-messages-embeds-files-etc
Only other issue I was able to find on the matter: Discord.js V13 sending message attachments
testchart2.php
– Agnail