dbotlinkgen
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Bot Link Generator

Generate an invite link to your Discord bot directly on your code.

NodeJS NPM TypeScript


Installation

# NPM
$ npm install dbotlinkgen

# Yarn
$ yarn add dbotlinkgen

Usage

// import { BotURL } from "dbotlinkgen";
const { BotURL } = require("dbotlinkgen");

const url = new BotURL()
    .setClient("942780735876628581")
    // .setScopes("bot") - Add "single" scope
    .setScopes(["bot", "applicationsCommands"]) // Add "multiple" scopes
    // .setGuild("942782748899307580") - Prefill a guild in the select menu
    // .disableSelect(true) - Disable the guild select menu
    // .addPermission("VIEW_CHANNEL") - Add permission one by one
    .addPermissions(["VIEW_CHANNEL", "SEND_MESSAGES"]); // Add multiple permissions

    if (!url.hasPermission("MANAGE_GUILD")) {
        url.addPermission("MANAGE_GUILD");
    }; // You can check and add permission as well

console.log(url.create()); // Create the url by using ".create()" method

Reference

const { BotURL } = require("dbotlinkgen");

const url = new BotURL()
    .setClient("942780735876628581")
    .setScopes(["bot", "applicationsCommands"])
    .setGuild("942782748899307580")
    .disableSelect(false)
    .addPermission("VIEW_CHANNEL")
    .addPermissions(["SEND_MESSAGES", "CREATE_INSTANT_INVITE"]);

    if (!url.hasPermission("VIEW_CHANNEL")) url.addPermission("VIEW_CHANNEL");

console.log(url.create());

License

MIT

Package Sidebar

Install

npm i dbotlinkgen

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

33.4 kB

Total Files

14

Last publish

Collaborators

  • nevenxr