presence-card
A simple package to show user presence using canvas.
Install
npm install presence-card
yarn add presence-card
Usage
Option | Type | Description |
---|
username | String | Username that will be display to the presence-card. |
userProfile | String | User profile that will be display to the presence-card.
File format: PNG/JPEG |
userStatus | String | User status that will be show to the presence-card.
Example: Online, Idle, Dnd, and Offline |
activity | String | Show user activity to the presence card. |
activityType | String | Show user activity type to the presence card. |
Code Usage
Example
const { presenceCard } = require("presence-card");
const { AttachmentBuilder } = require("discord.js");
client.on("interactionCreate", async (message) => {
const cardPresence = await presenceCard({
username: client.user.username,
userProfile: client.user.displayAvatarURL({ extension: 'png' }),
userStatus: "online",
activity: "shittybot.xyz | /help",
activityType: "Listening",
})
const attachment = new AttachmentBuilder(cardPresence, {
name: "card.png",
});
interaction.channel.send({
files: [attachment],
});
});
client.login("token");