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

    2.0.0 • Public • Published

    Xfinity

    Easy to use discord.js multipurpose package for your bot! Uses discord.js v13.

    Installation

    npm i xfinity
    yarn add xfinity
    pnpm add xfinity

    Getting Started

    What's New?

    1. Removed most unused functions
    2. Converted the package to slash only
    3. 75% Customization added.

    Functions

    Currently it supports following functions:

    Button Suggest System

    Suggest system with buttons. Customizable also.

    const xfinity = require("xfinity");
    
    // For slash command first you need to define options just like this:
    options: [
      {
        name: "suggestion", //dont change
        description: "What do you want to suggest?", // can be anything
        type: "STRING", //dont change
        required: true, // dont change
      },
    ],
      //slash command
      xfinity.suggestion(interaction, client, {
        chid: "your channel id",
        deny: "DARK_BUT_NOT_BLACK", //default: red
        suggest: "DARK_GOLD", //default: black
        accept: "DARK_GREEN", //default: green
      });

    Giveaway

    Reaction based giveaway system.

    const xfinity = require("xfinity");
    
    //slash command
    
    xfinity.giveaway(interaction, {
      congratsmsg: "YOU WON", //optional
      color: "BLUE", //optional
    });
    
    //NOTE: YOU NEED TO DEFER YOUR INTERACTION BEFORE USING SLASH COMMAND.

    Pagination Using Menus

    You can use this to make multi page embeds using menus.

    const xfinity = require("xfinity");
    let pages = [
      new Discord.MessageEmbed().setAuthor("Page 1"),
      new Discord.MessageEmbed().setAuthor("page 2"),
    ];
    
    //slash command
    
    xfinity.mPagination(interaction, pages, {
      description: " Position #{position}", //optional
      label: "Click this to get to #{position}", //optional
    });

    Ticket with Buttons

    So you like button? Well then this function is for you!

    const xfinity = require("xfinity");
    
    //in main file
    xfinity.handleinteraction(client);
    
    //if you want slash command
    xfinity.bTicket(interaction, {
      bcolor: "green", //optional
    });

    Transcript

    Want to generate a file for all messages in the channel? Use this function.

    //transcript command
    
    const xfinity = require("xfinity");
    const { MessageAttachment } = require("discord.js");
    //number of messages can be below 100
    xfinity.fetchTranscript(message.channel, message, 100).then((data) => {
      const file = new MessageAttachment(data, "index.html");
      message.channel.send({ files: [file] });
    });

    Handle Interaction Event

    Used for handling all buttons.

    const xfinity = require("xfinity");
    xfinity.handleinteraction(client, {
      closeButtonColor: "DANGER", // optional
      reopenButtonColor: "SUCCESS", // optional
      deleteButtonColor: "DANGER", // optional
      deleteChannelButtonColor: "DANGER", // optional
      trasncriptButtonColor: "PRIMARY", // optional
      yesButtonColor: "SECONDARY", // optional
      noButtonColor: "SUCCESS", // optional
      ticketName: "{username}", // optional
      spamMessage: "Test", // optional
      confirmationMessage: "Test", // optional
      ticketOpenMessage: "test", // optional
      ticketOpenEmbedColor: "RED", // optional
      confirmationEmbedColor: "GREEN", // optional
      ticketDeleteMessage: "TEST", // optional
      ticketDeleteCancelMessage: "TEST", // optional
      closeDescription: "ET", // optional
      parentId: "parent id here", // optional
    });

    Classes

    Modlogs (👇)

    Examples here

    Got some errors/bugs?

    Join here for help.

    Install

    npm i xfinity

    DownloadsWeekly Downloads

    12

    Version

    2.0.0

    License

    Apache-2.0

    Unpacked Size

    61.2 kB

    Total Files

    17

    Last publish

    Collaborators

    • xfinity_yt