Skip to main content

Sapphire Logo

@sapphire/discord-utilities

Discord specific utilities for your JavaScript/TypeScript bots.

GitHub npm bundle size npm

Description

When developing Discord bots or frameworks for Discord bots we often run into certain constants such as regex's, channel type resolutions and other common functions that would be really nice to get from 1 centralized place. That's where @sapphire/discord-utilities come in. This package provides common Discord specific utilities for your Discord bots.

Important: If you're looking for Discord.js specific utilities then install @sapphire/discord.js-utilities instead. @sapphire/discord.js-utilities re-exports this package at the root level and peer-depends on this package.

Features

  • Written in TypeScript
  • Bundled with esbuild so it can be used in NodeJS and browsers
  • Offers CommonJS, ESM and UMD bundles
  • Fully tested
  • Discord library agnostic

Installation

You can use the following command to install this package, or replace npm install with your package manager of choice.

npm install @sapphire/discord-utilities

Buy us some doughnuts

Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!

We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.

Donate WithAddress
Open CollectiveClick Here
Ko-fiClick Here
PatreonClick Here
PayPalClick Here

Contributors

Please make sure to read the Contributing Guide before making a pull request.

Thank you to all the people who already contributed to Sapphire!