Skip to content

shittybot/presence-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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");

About

A simple package to show user presence using canvas.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published