Skip to content

ephemeralrogue/spades

Folders and files

NameName
Last commit message
Last commit date
Mar 11, 2025
Oct 3, 2023
Mar 12, 2025
Oct 3, 2023
Oct 3, 2023
Sep 20, 2023
Dec 10, 2024
Oct 24, 2024
Oct 3, 2023
Oct 24, 2024
Mar 11, 2025
Mar 12, 2025
Mar 11, 2025

Repository files navigation

Spades


the lvnacy emblem, a gray circle with a large black 'V' superimposed.

Another Discord.js Bot Template

L V N A C Y BlueskyL V N A C Y Discord



This is a basic discord bot template written in JS, running in Node v22+. The bot is built with minimal dependencies:

  • discord.js library to interact with the Discord API,
  • sapphire, a command framework as an extension of discord.js,
  • esLint, a code linter for keeping code consistent across all files,
  • dotenv for configuring and utilizing .env files,
  • a mongodb node driver, for connecting and interaction with an instance of MongoDB Atlas,
  • pino, a lightweight logger, and
  • pnpm as the package manager.

The idea is to get a bot up a running with logging, database connectivity, and a solid command structure. The utilities are barebones--build them up or swap them out at your leisure.

Getting Started

Tap or click the "Use this template" and create a new repository. copy the .env.template, rename it to .env, and fill out the fields with your credentials. you'll need:

  • a bot token, application id, and public key from Discord. You can find those in the Discord Developer Portal when you create an app,
  • a URI connection string from MongoDB Atlas, and
  • a client key--known as a "DSN"--from Sentry.

You may also want to install Docker and Docker Compose, if you want to run the bot in a container.

Once all the fields are filled out, you can:

pnpm install

then

pnpm start

to run the bot locally through Node in your dev environment, or:

docker compose up

to run the bot in a Docker container.

If all works well, you should see your bot active in your Discord server once you invite it. To test it, run the /ping command.

Ongoing Development

active development will take place as libraries and frameworks are updated, or to improve error tracing, logging, and app monitoring. if you're interested in contributing to the source code or find a bug to report, reach out to me on Bluesky; issue guides will be forthcoming.

And that's it! happy building!