discord-canvas
discord-canvas copied to clipboard
Unhandled Promise Rejection Warning: Error: connect ETIMEDOUT
( Client is created at the beginning of my code )
` client.on("guildMemberAdd", async (member) => { const { MessageAttachment } = require('discord.js') const Canvas = require("discord-canvas")
const user = member.user;
const image = await new Canvas.Welcome()
.setUsername(user.username)
.setDiscriminator(user.discriminator)
.setMemberCount(member.guild.memberCount)
.setGuildName(member.guild.name)
.setAvatar(user.displayAvatarURL({ format: 'png' }))
.setColor("border", "#8015EA")
.setColor("username-box", "#8015EA")
.setColor("discriminator-box", "#8015EA")
.setColor("message-box", "#8015EA")
.setColor("title", "#8015EA")
.setColor("avatar", "#8015EA")
.setBackground("https://site.com/background.jpg")
.toAttachment();
const attachment = new MessageAttachment((await image).toBuffer(), "goodbye-image.png");
const channel = member.guild.channels.cache.find(ch => ch.name == 'welcome');
channel.send(attachment);
}) `
This code in my discord bot isn't working for some reason, I've tried it without the canvas part and it worked perfectly, so I don't know what is wrong. I uninstalled and reinstalled discord-canvas but it still won't work. The error I get is:
UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 204.74.99.100:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
same, rip discord-canvas
No it is a problem with your PC not discord-canvas
Hello, change « site.com/.... » before