xixi52 / discord-canvas

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

Not working #40

Closed TheInsanec0der closed 3 years ago

TheInsanec0der commented 3 years ago

Hey, can someone help me with this? This code does not work...

const Discord = require('discord.js')
        const canvas = require('discord-canvas'),
        welcomeCanvas = new canvas.Welcome();
        let image = await welcomeCanvas
        .setUsername("${username}")
        .setDiscriminator("${discrim}")
        .setMemberCount("${members}")
        .setGuildName("${guild}")
        .setAvatar("${avatar}")
        .setColor("border", "#ff0000")
        .setColor("username-box", "#660000")
        .setColor("discriminator-box", "#ff0000")
        .setColor("message-box", "#ff6666")
        .setColor("title", "#ff0000")
        .setColor("avatar", "#660000")
        .setBackground("${background}")
        .toAttachment();
let attachment = new Discord.MessageAttachment(image.toBuffer(), "card.png");
message.channel.send(attachment)

There is no error, but the bot does not respond...

TheInsanec0der commented 3 years ago

Also isn't there a support discord?

crqch commented 3 years ago

Do you have the bit of code in client.on('message') event?