kdprod is a powerful and easy-to-use Node.js library that provides functionalities for creating dynamic Discord profile images. It allows you to generate stunning welcome and rank cards for your Discord bot users with minimal effort.
Install kdprod using npm:
npm i kdprod
Welcome Card
const { Client } = require("discord.js");
const { DiscordProfile } = require('kdprod');
const canvas = new DiscordProfile();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
let imageURL = 'https://i.imgur.com/ea9PB3H.png';
const image = await canvas.welcome(message.author, { link: imageURL, blur: false });
message.channel.send({ files: [image] });
});
client.login('Your-Bot-Token');
Rank Card
const { Client } = require("discord.js");
const { DiscordProfile } = require('kdprod');
const canvas = new DiscordProfile();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
],
});
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
try {
let imageURL = 'https://i.imgur.com/ea9PB3H.png';
const image = await canvas.rankcard({
member: message.author,
currentXP: 50,
fullXP: 100,
level: 1,
rank: 5,
link: imageURL
});
message.channel.send({ files: [image] });
} catch (e) {
console.log(e);
}
});
client.login('Your-Bot-Token');
This project is licensed under the MIT License. Feel free to contribute and use it in your projects!