unddasnoch
unddasnoch
DIAdiscord.js - Imagine an app
Created by unddasnoch on 12/21/2023 in #djs-questions
modal password warning removal
No description
4 replies
DIAdiscord.js - Imagine an app
Created by DapperNurd on 12/14/2023 in #djs-questions
Database connection... MongoDB vs MySQL?
I myself use SQLite and I’m pretty happy with it so far
5 replies
DIAdiscord.js - Imagine an app
Created by unddasnoch on 12/6/2023 in #djs-questions
discord message reactions
ohhh yeah that solved it thanks :3
5 replies
DIAdiscord.js - Imagine an app
Created by unddasnoch on 12/5/2023 in #djs-questions
embedding an manipulated image inside the box
yeah that was the problem thanks 😮
9 replies
DIAdiscord.js - Imagine an app
Created by unddasnoch on 12/5/2023 in #djs-questions
embedding an manipulated image inside the box
const canvas = createCanvas(400, 200);
const ctx = canvas.getContext('2d');

const backgroundImage = await loadImage('./src/background.png');
ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height);

const userAvatar = await loadImage(member.user.displayAvatarURL({ extension: "png" }));
ctx.beginPath();
ctx.arc(200, 100, 70, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
ctx.drawImage(userAvatar, 130, 30, 140, 140);

const attachedImage = new AttachmentBuilder(canvas.toBuffer(), 'welcomeImage.png');

const embedWelcomeBox = new EmbedBuilder()
.setTitle(`${member.displayName}, Welcome to this great server`)
.setImage('attachment://welcomeImage.png')
.setColor(0xc36bdb)

channel.send({ embeds: [embedWelcomeBox], files: [attachedImage] });
const canvas = createCanvas(400, 200);
const ctx = canvas.getContext('2d');

const backgroundImage = await loadImage('./src/background.png');
ctx.drawImage(backgroundImage, 0, 0, canvas.width, canvas.height);

const userAvatar = await loadImage(member.user.displayAvatarURL({ extension: "png" }));
ctx.beginPath();
ctx.arc(200, 100, 70, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
ctx.drawImage(userAvatar, 130, 30, 140, 140);

const attachedImage = new AttachmentBuilder(canvas.toBuffer(), 'welcomeImage.png');

const embedWelcomeBox = new EmbedBuilder()
.setTitle(`${member.displayName}, Welcome to this great server`)
.setImage('attachment://welcomeImage.png')
.setColor(0xc36bdb)

channel.send({ embeds: [embedWelcomeBox], files: [attachedImage] });
9 replies
DIAdiscord.js - Imagine an app
Created by unddasnoch on 12/5/2023 in #djs-questions
embedding an manipulated image inside the box
im using discord.js v14 and canvas btw
9 replies