Hot Summer Deals are Here!
Celebrate with up to 99% off on 17,700 resources
01
Days
13
Hours
04
Mins
15
Secs

Discord.js Canvas help

Status
This thread has been locked.

longdog

Supreme
Feedback score
8
Posts
338
Reactions
179
Resources
0
I'm working on a bot that makes a custom image for when people join with their profile picture and name. I have both those things working I just need to correctly position and size it.

My code for the profile picture is
Code:
const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
    const avatar = await Canvas.loadImage(buffer);
    ctx.drawImage(avatar, 10, 10, 150, 150);

And it shows up like this https://gyazo.com/235e6551689d7bc013850905547d3ff9
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Medi

Bot Developer
Premium
Feedback score
27
Posts
393
Reactions
171
Resources
1
Yikes, I havent used much canvas, But I would imagine you would need to resize.. Have you looked into something like jimp?
 

Medi

Bot Developer
Premium
Feedback score
27
Posts
393
Reactions
171
Resources
1
No problem, Jimp can be a little confusing compared to canvas IMO, but gl.
 
Status
This thread has been locked.
Top