MY Code is not working
client.on("guildMemberAdd", async member => {
const canvas = Canvas.createCanvas(1772, 633);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage(
./welcome.png
);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#f2f2f2';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
var textString3 = ${member.user.username}
;
if (textString3.length >= 14) {
ctx.font = 'bold 100px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString3, 720, canvas.height / 2 + 20);
}
else {
ctx.font = 'bold 150px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString3, 720, canvas.height / 2 + 20);
}
var textString2 = #${member.user.discriminator}
;
ctx.font = 'bold 40px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString2, 730, canvas.height / 2 + 58);
var textString4 = Member #${member.guild.memberCount}
;
ctx.font = 'bold 60px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.fillText(textString4, 750, canvas.height / 2 + 125);
var textString4 = ${member.guild.name}
;
ctx.font = 'bold 60px Genta';
ctx.fillStyle = '#f2f2f2';
ctx.beginPath();
ctx.arc(315, canvas.height / 2, 250, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
ctx.drawImage(avatar, 65, canvas.height / 2 - 250, 500, 500);
const attachment = new MessageAttachment(canvas.toBuffer(), 'welcome-image.png');
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setTitle('Begrüßen')
.setStyle('SECONDARY')
.setCustomId('begrusn')
)
const channel = client.channels.cache.get('1037278054503956550')
channel.send({
files: [attachment],
components: [row]
})9 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That's not enough information
huh
its the code
You didn't provide enough information, we don't know the problem
iam in js version v13.12.0
and thats it
it doesn't give me any error
it just does nothing
Did you debug it?
If you aren't getting any errors, try to place
console.log
checkpoints throughout your code to find out where execution stops.
• Once you do, log relevant values and if-conditions
• More sophisticated debugging methods are breakpoints and runtime inspections: learn more
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
• Note: if you initialize your Client as bot
or other identifiers you need to use these instead of client
• If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebini could try
bruh
so the bot doesn't even detect if a user joins
i hate this
bro
just help me
What are your client intents