2.1.1 • Published 3 years ago

discord-premium-utils v2.1.1

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

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

3 years ago

2.1.0

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago