npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xfinity

v2.0.0

Published

Easy to use discord.js multipurpose package for your bot

Downloads

58

Readme

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.