Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

presence-card

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

presence-card

A simple package to show discord user presence card using canvas.

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

OptionTypeDescription
usernameStringUsername that will be display to the presence-card.
userProfileStringUser profile that will be display to the presence-card.

File format: PNG/JPEG
userStatusStringUser status that will be show to the presence-card.

Example: Online, Idle, Dnd, and Offline
activityStringShow user activity to the presence card.
activityTypeStringShow 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");


Keywords

FAQs

Package last updated on 07 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc