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

discord-shine

v0.0.3

Published

A collection of typescript utilities to utilize in Discord bots.

Readme

discord-shine

About

discord-shine is a TypeScript utility module wrapping both the discord.js and discord.js-commando modules. It was built as an anchor point to standardize certain aspects of the way I personally make my Discord bots to minimize code reuse between the projects. It comes equipped with various utilities that, while not necessarily centered on a specific theme, are simply utilities that I have constructed specifically to meet the needs of my Discord bots.

As of now, the framework is limited to what I have specifically needed, but can certainly be expanded.

Features

discord-shine features the following amenities:

  • A robust sound framework wrapping the discord.js sound framework allowing for voice channel management and queued playback that scales between guilds
  • A bot manager class establishing singleton access to the bot client
  • A login manager keeping the bot online in the case of connection issues
  • A name resolution system allowing for the resolving of user-input strings to specific objects in the context of guild; this uses the Levenshtein distance alogrithm to find the closest match among a group of objects

Installation

For basic installation, use:

npm install discord-shine --save

Note: Because this library depends heavily on the discord.js and discord.js-commando frameworks, please refer to their documentation for optional installations, most notably the voice support.

Example Usage

For simply the login manager, import the login manager and instantiate it the CommandoClient and bot token; the manager itself will work autonomously.

// Assuming bot is your CommandoClient and token is your bot's token
let loginManager = new LoginManager(bot, token);

For a full-fledged encapsulation of the bot as a manager, including initializing the singleton access, make a class inheriting from BotManager:

class MyBotManager extends BotManager {
    constructor(prefix, owner) {
        super(new CommandoClient({ commandPrefix: prefix, owner: owner }));
    }

    run(token) {
        super.run(token);
    }
}

To configure the sound file system, use the following:

// Assuming soundPath is the path to a folder containing the sound files you
// want your bot to have access to
SoundFileManager.initialize(soundPath);

To make use of the GuildAudioPlayer framework, retrieve the guild's specific player using its id and operate from there:

// Assuming guild is a Guild object representing the guild you want to play
// in and voiceChannel is a VoiceChannel object of the voice channel you want
// to join
let player = GuildAudioPlayer.getGuildAudioPlayer(guild.id);
player.join(voiceChannel);

let sound = SoundFileManager.getFileSound("quack.wav");
player.add(sound);
player.play();

// Alternatively, the joinAndPlay flag can be set on the player to allow for
// quick joining, playing, and leaving
player.joinAndPlay = true;
player.add(sound);

The name resolution utility offers a powerful way to resolve strings to Discord objects:

// Gets a voice channel based on the name of the voice channel from a specific guild
let voiceChannel = stringToVoiceChannel("myVoiceChannel", guild);

Help

If you have any questions or comments, feel free to contact me on Discord at SweetWilly013#2452.

Links