xixi52 / discord-canvas

A package to simplifie the usage of canvas for Discord !
87 stars 45 forks source link

Unhandled Promise Rejection Warning: Error: connect ETIMEDOUT #34

Open hwamzz opened 3 years ago

hwamzz commented 3 years ago

( 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)

0x6461726B commented 3 years ago

same, rip discord-canvas

imyanice commented 3 years ago

No it is a problem with your PC not discord-canvas

xixi52 commented 3 years ago

Hello, change « site.com/.... » before