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

wv3-discord.js-stock

v1.1.1

Published

Stock bot helpers and bootstrapping built on top of wv3-discord.js.

Downloads

199

Readme

wv3-discord.js-stock

wv3-discord.js-stock is the stock-bot convenience layer built on top of wv3-discord.js.

It keeps the original package shape:

  • Client with default command and event loading
  • BaseMainClient for custom startup control
  • GeneralCmds and StockCmds helpers
  • WebAutomation Playwright helpers
  • log and EventHandler

The implementation now uses wv3-discord.js for the Discord client, REST API, slash-command builders, embeds, attachments, collections, and event constants.

Changelog

See CHANGELOG.md for version history from 1.0-pre1 through the current release.

Install

This repo currently wires the package to the sibling wv3-discord.js project through a local file dependency:

npm install

If you publish the package, replace the file: dependency in package.json with a semver release of wv3-discord.js.

Requirements:

  • Node.js 18+
  • a Discord bot token
  • a Discord application ID
  • a Discord guild ID for slash command deployment

Quick Start

const { Client } = require("wv3-discord.js-stock");

const bot = new Client({
  config: {
    token: process.env.DISCORD_BOT_TOKEN,
    clientId: process.env.DISCORD_CLIENT_ID,
    guildId: process.env.DISCORD_GUILD_ID
  }
});

bot.boot();

By default, Client loads the package command and event folders and deploys guild commands before logging in.

Default Commands

  • /ping
  • /about
  • /status
  • /help

Add Commands

Inline command example:

const { Client, SlashCommandBuilder } = require("wv3-discord.js-stock");

const bot = new Client({
  cmds: [
    {
      data: new SlashCommandBuilder()
        .setName("hello")
        .setDescription("Say hello"),
      async execute(interaction) {
        await interaction.reply("Hello!");
      }
    }
  ],
  config: {
    token: process.env.DISCORD_BOT_TOKEN,
    clientId: process.env.DISCORD_CLIENT_ID,
    guildId: process.env.DISCORD_GUILD_ID
  }
});

bot.boot();

File-based loading example:

const { Client } = require("wv3-discord.js-stock");

const bot = new Client({
  files: {
    commands: ["./commands"],
    events: ["./events"]
  },
  config: {
    token: process.env.DISCORD_BOT_TOKEN,
    clientId: process.env.DISCORD_CLIENT_ID,
    guildId: process.env.DISCORD_GUILD_ID
  }
});

bot.boot();

Command modules can export either a single command object or an object with a commands array.

BaseMainClient

Use BaseMainClient when you want the same command deployment and module loading helpers without the stock defaults.

const {
  BaseMainClient,
  GatewayIntentBits,
  SlashCommandBuilder
} = require("wv3-discord.js-stock");

const bot = new BaseMainClient({
  cmds: [
    {
      data: new SlashCommandBuilder()
        .setName("ping")
        .setDescription("Ping"),
      async execute(interaction) {
        await interaction.reply("Pong!");
      }
    }
  ],
  config: {
    token: process.env.DISCORD_BOT_TOKEN,
    clientId: process.env.DISCORD_CLIENT_ID,
    guildId: process.env.DISCORD_GUILD_ID,
    intents: [GatewayIntentBits.Guilds]
  }
});

bot.start();

Stock Helpers

StockCmds exports:

  • createStockService(options)
  • createStockCommands(options)
  • maskInventoryLine(line)

createStockCommands() expects:

  • client
  • ensureStaff(interaction)
  • dataDir
  • notifyChannelId
  • log

It provides:

  • /stock
  • /restock
  • /create-order

Web Automation

WebAutomation exports:

  • openBrowser(options)
  • createAutomationSession(options)
  • runAutomation(options)
  • runAutomationStep(page, step, index)
  • runAutomationSteps(page, steps)
  • runExample()

Core Re-exports

The package also re-exports the wv3-discord.js core surface, including:

  • WV3Client
  • REST
  • Routes
  • Collection
  • GatewayIntentBits
  • Events
  • EmbedBuilder
  • AttachmentBuilder
  • SlashCommandBuilder

Notes

  • Guild slash commands are deployed with Routes.applicationGuildCommands(...).
  • If autoDeployCommands is not set to false, commands deploy automatically.
  • If autoLogin is not set to false, the bot logs in automatically.
  • If token, clientId, or guildId are missing, deployment is skipped with a warning.