Ninja Parading Musically

    discord-premium-utils
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.1 • Public • Published

    npm installnfo

    NPM version NPM downloads Dependencies

    Table of contents

    About

    A simple Node.js package to use with discord.js to see if a user is subscribed to Discord Nitro!

    Installation

    npm install discord-premium-utils

    Importing

    CommonJS

    const PremiumUtils = require("discord-premium-utils");
    
    // OR
    const { hasNitro, probablyHasNitro, isBoosting } = require("discord-premium-utils");

    ES6

    import PremiumUtils from "discord-premium-utils";
    
    // OR
    import { hasNitro, probablyHasNitro, isBoosting } from "discord-premium-utils";

    Example

    import { Client } from "discord.js";
    import { hasNitro, probablyHasNitro, isBoosting } from "discord-premium-utils";
    
    const client = new Client();
    
    client.on("ready", () => {
        console.log("Client is logged in!");
    });
    
    client.on("message", message => {
        if (message.content === "!checknitro") {
            if (hasNitro(message.author)) {
                message.channel.send("You have nitro!");
            } else if (probablyHasNitro(message.author)) {
                message.channel.send("You probably have nitro!");
            } else {
                message.channel.send("You probably don't have nitro!");
            }
        }
    
        if (message.content === "!checkboosting") {
            if (isBoosting(message.author)) {
                message.channel.send("You are server boosting!");
            } else {
                message.channel.send("You are probably not server boosting!");
            }
        }
    });
    
    client.login("token");

    Install

    npm i discord-premium-utils

    DownloadsWeekly Downloads

    18

    Version

    2.1.1

    License

    ISC

    Unpacked Size

    11.4 kB

    Total Files

    8

    Last publish

    Collaborators

    • thehackerboi69