@helpr/modern-rank-card
v1.0.2
Published
A modern rank card for your level system on Discord.
Downloads
46
Readme
@helpr/modern-rank-card
This version is used by the Discord Bot Helpr to generate rank cards
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 @helpr/modern-rank-cardHere's a complete example (compatible with discord.js v14+)
const Canvas = require("@helpr/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] })