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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fishy-bot-framework

v0.3.3

Published

A basic framework for making interaction based discord bot

Readme

FishyBot Framework

A framework for creating complex discord bots easily.

How to use:

  1. install the package with npm install fishy-bot-framework -s
  2. import the package with either import * as FBF from "fishy-bot-framework" or const FBF = require("fishy-bot-framework")
  3. Start a new client:
import * as FBF from "fishy-bot-framework"
const client = new FBF.FishyClient({
  token:"discord bot token",
  author:"Your name",
  db_uri: "mongodb://myDBReader:D1fficultP%[email protected]:27017",
  guild_model: GuildModel,
  cmd_dir: "dist/commands",
})
client.login()

Commands:

A basic command should look something like this

// The code that gets run when the command gets called;
// It takes the arguments `FishyClient` and `Interaction`
export const run: FishyCommandCode = async (client, interaction) => {
  interaction.send(`Current websocket ping: \`${client.ws.ping}ms\``);
};

// The configuration of the commands, it needs this to run
export const config: FishyCommandConfig = {
  name: "ping",               // Name of the command
  bot_needed: false,          // If the bot user is required to be in the guild
                              // Needed for `Interaction.channel.send()` for example
  user_perms: [],             // An array of permissions the user needs to run the command
  interaction_options: {      // Discord interaction options
                              // https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command-json-params
    name: "ping",
    description: "Ping the bot"
  },
};

Use these steps to create a new category

create - /commands/"category"/
create - /commands/"category"/index.ts
export - "name" & "description" from /commands/"category"/index.ts
create - /commands/"category"/command.ts

Example:

image

Buttons!

To create a button you can run:

interaction.send("Message", {
  components: [
    {
      type: ComponentType.ActionRow,
      components: [
        {
          type: ComponentType.Button,
          style: ComponentStyle.Success,
          label: "HEY",
          custom_id: "send_ping",
        },
      ],
    },
  ],
});

To run code when this button is pressed, you can create a new file just like a normal command. You can put this file anywhere you can place a normal command.

Put this code in the new file:

export const run: FishyComponentCommandCode = async (client, interaction) => {
  if (interaction instanceof ButtonInteraction) {
    const memberID = interaction.data.custom_id.slice(config.custom_id.length);
    const member = await interaction.guild?.members.fetch(memberID);
    await member?.kick();
    interaction.send("Kicked the member!");
  }
};

export const config: FishyComponentCommandConfig = {
  custom_id: "kick_",
  atStart: true,
  bot_needed: true,
  user_perms: ["KICK_MEMBERS"],
};

Select menus

To send a select menu, just like a button, you need to send message components

interaction.send("oi", {
  components: [
    {
      type: ComponentType.ActionRow,
      components: [
        {
          type: ComponentType.Select,
          custom_id: "selectOption",
          options: [
            {
              label:"Option 1", value:"1",
              label:"Option 2", value:"2",
              label:"Option 3", value:"3",
              label:"Option 4", value:"4",
              label:"Option 5", value:"5",
            }
          ],
          max_values: 3,
          min_values: 1,
        },
      ],
    },
  ],
})

Then to do something with them

export const run: FishyComponentCommandCode = async (client, interaction) => {
  if (interaction instanceof SelectInteraction) {
    interaction.sendSilent(`You have selected: \`${interaction.data.values.join(", ")}\``);
  }
};

export const config: FishyComponentCommandConfig = {
  custom_id: "selectOption",
};

Events

A basic event file should look something like this:

export const trigger: WSEventType | string = "INTERACTION_CREATE";
export async function run(client, data){

};

Database

Required Mongoose data fields:

{
  id: String,     // The guild's id for fetching, index this
  settings: Object   // Used for disabeling commands
}