presence-card

1.0.0 • Public • Published

presence-card

A simple package to show user presence using canvas.

NPM version

NPM Banner


Install

npm install presence-card
# or
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");

Package Sidebar

Install

npm i presence-card

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

8.05 kB

Total Files

7

Last publish

Collaborators

  • lewdhutao_