0.4.0 • Published 8 months ago
modern-rank-card v0.4.0
modern-rank-card
Easy setup!
With modern-rank-card
you can add beautiful modern images to the ranks of your Discord bot level system.
Beautiful, Efficient and Light.
Installation
$ npm install --save modern-rank-card
Here's a complete example (compatible with discord.js v14+)
const Canvas = require("modern-rank-card"),
const { AttachmentBuilder } = require("discord.js");
let image = await new Canvas.RankCard()
.setAddon("xp", false)
.setAddon("rank", false)
.setAddon("color", true)
.setAvatar(message.author.displayAvatarURL({ extension: "png" }))
.setUsername(message.author.username)
.setLevel(96)
.setXP("current", 26300)
.setXP("needed", 51000)
.setColor("level", "#ffffff")
.setBackground("https://i.imgur.com/hwgvX0t.png")
.toAttachment();
let attachment = new AttachmentBuilder(image.toBuffer(), { name: "rank.png" });
message.channel.send({ file: [attachment] })
Patch Notes
Version 0.4.0
Updates:
- Canvas Dependency Update
The project has been updated to usecanvas@3.0.0-rc2
. This update addresses compatibility issues with Node.js v22.11.0.
Bug Fixes:
- Resolved compatibility bugs that occurred when using Node.js v22.11.0.
- Enhanced performance and stability by adopting the latest prebuilt binaries from
canvas
.
Credits
Made by BvrDev My Discord: @rightthere