Skip to content

Commit 11b4a95

Browse files
committed
Gutted Sentry.
Refactored logger. Removed unnecessary dependencies and added necessary ones. Updated existing dependencies. Moved README and LICENSE to .github folder. Additional changes.
1 parent 6f4a159 commit 11b4a95

File tree

12 files changed

+1647
-2188
lines changed

12 files changed

+1647
-2188
lines changed

LICENSE renamed to .github/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 nonsense
3+
Copyright (c) 2025 L V N A C Y
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

.github/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<h1 align="center">Spades</h1>
2+
3+
<p align="center">
4+
<br>
5+
<img
6+
src="./assets/lvnacy_emblem_plain.png"
7+
alt="the lvnacy emblem, a gray circle with a large black 'V' superimposed."
8+
width="120px"
9+
/>
10+
<br>
11+
<br>
12+
<i>
13+
Another Discord.js Bot Template
14+
</i>
15+
<br>
16+
</p>
17+
18+
<p align="center">
19+
20+
<a href="https://bsky.app/profile/lvnacy.xyz/">L V N A C Y Bluesky</a>
21+
22+
<a href="https://discord.gg/nh7mqGEfbw">L V N A C Y Discord</a>
23+
24+
<br>
25+
</p>
26+
<hr>
27+
<br>
28+
29+
This is a basic discord bot template written in JS, running in Node v22+. The
30+
bot is built with minimal dependencies:
31+
- [discord.js](https://discord.js.org) library to interact with the
32+
[Discord API](https://discord.com/developers/docs/intro),
33+
- [sapphire](https://www.sapphirejs.dev), a command framework as an extension
34+
of discord.js,
35+
- [esLint](https://eslint.org), a code linter for keeping code consistent
36+
across all files,
37+
- [dotenv](https://www.dotenv.org/docs) for configuring and utilizing `.env`
38+
files,
39+
- a [mongodb](https://mongodb.github.io/node-mongodb-native/) node driver, for
40+
connecting and interaction with an instance of MongoDB Atlas,
41+
- [pino](https://getpino.io/), a lightweight logger, and
42+
- [pnpm](pnpm.io) as the package manager.
43+
44+
The idea is to get a bot up a running with logging, database connectivity, and
45+
a solid command structure. The utilities are barebones--build them up or swap
46+
them out at your leisure.
47+
48+
## Getting Started
49+
Tap or click the "Use this template" and create a new repository. copy the
50+
`.env.template`, rename it to `.env`, and fill out the fields with your
51+
credentials. you'll need:
52+
- a bot token, application id, and public key from Discord. You can find those
53+
in the [Discord Developer Portal](https://discord.com/developers) when you
54+
create an app,
55+
- a URI connection string from [MongoDB Atlas](https://mongodb.com), and
56+
- a client key--known as a "DSN"--from [Sentry](https://sentry.io).
57+
58+
You may also want to install Docker and Docker Compose, if you want to run the
59+
bot in a container.
60+
61+
Once all the fields are filled out, you can:
62+
```bash
63+
pnpm install
64+
```
65+
then
66+
```bash
67+
pnpm start
68+
```
69+
to run the bot locally through Node in your dev environment, or:
70+
```bash
71+
docker compose up
72+
```
73+
to run the bot in a Docker container.
74+
75+
If all works well, you should see your bot active in your Discord server once
76+
you invite it. To test it, run the `/ping` command.
77+
78+
## Ongoing Development
79+
active development will take place as libraries and frameworks are updated, or
80+
to improve error tracing, logging, and app monitoring. if you're interested in
81+
contributing to the source code or find a bug to report, reach out to me on
82+
[Bluesky](https://bsky.app/profile/lvnacy.xyz); issue guides will be
83+
forthcoming.
84+
85+
And that's it! happy building!
122 KB
Loading

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1717
- name: Build the Docker image
1818
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

.github/workflows/pr-prep.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ jobs:
1111

1212
name: lint code
1313
runs-on: ubuntu-22.04
14-
14+
strategy:
15+
matrix:
16+
node-version: [22]
1517
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v3
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
21+
- name: Install Node
22+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
1823
with:
19-
node-version: 20
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'pnpm'
2026
- name: Install dependencies
21-
run: npm install
27+
run: pnpm install
2228
- name: Lint Code
23-
run: npm run lint
29+
run: npx eslint

README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import globals from 'globals';
2+
import stylistic from '@stylistic/eslint-plugin';
23

34

45
export default [
@@ -8,7 +9,14 @@ export default [
89
ecmaVersion: 'latest'
910
},
1011
files: [ '**/*.js' ],
12+
plugins: {
13+
'@stylistic': stylistic
14+
},
1115
rules: {
16+
'@stylistic/indent': [
17+
'error',
18+
'tab'
19+
],
1220
semi: [
1321
'error',
1422
'always'

0 commit comments

Comments
 (0)