Skip to content

Commit cac4256

Browse files
updated dependencies
- updated sapphire framework - rolled events folder into sapphire system - updated `ClientReady` event to be ready by sapphire
1 parent 543cc19 commit cac4256

File tree

6 files changed

+137
-121
lines changed

6 files changed

+137
-121
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# changelog
22

3+
## release 2.0.0 (12.10.24)
4+
1. improved docker implementation
5+
2. updated dependencies
6+
- updated sapphire framework
7+
- rolled events folder into sapphire system
8+
- updated `ClientReady` event to be ready by sapphire
9+
310
## release (10.11.23)
411
1. foregoing semver updates per template use
512
2. created pr-prep yaml for github actions

package-lock.json

+83-70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "spades",
33
"description": "discord.js bot template",
4-
"version": "1.0.1",
4+
"version": "2.0.0",
55
"main": "src/app/app.js",
66
"type": "module",
77
"author": "nonsensetwice",
@@ -26,7 +26,7 @@
2626
},
2727
"homepage": "https://github.com/nonsensetwice/spades#readme",
2828
"dependencies": {
29-
"@sapphire/framework": "^4.6.0",
29+
"@sapphire/framework": "^5.3.1",
3030
"@sentry/integrations": "^7.70.0",
3131
"@sentry/node": "^7.119.2",
3232
"@sentry/tracing": "^7.70.0",
@@ -36,6 +36,9 @@
3636
"pino": "^8.15.1",
3737
"pino-sentry-transport": "^1.0.5"
3838
},
39+
"overrides": {
40+
"whatwg-url": "^14.0.0"
41+
},
3942
"devDependencies": {
4043
"eslint": "^9.13.0",
4144
"globals": "^15.11.0"

src/app/app.js

+3-34
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import { readdir } from 'fs/promises';
2-
import { join } from 'path';
31
import {
42
GatewayIntentBits,
53
Partials
64
} from 'discord.js';
7-
import { SapphireClient } from '@sapphire/framework';
5+
import OverloadClient from './utils/OverloadClient.js';
86
import Log from './utils/Log.js';
97
import { init, Integrations } from '@sentry/node';
108
import { RewriteFrames } from '@sentry/integrations';
119

1210
initializeSentryIO();
1311

1412
const client = initializeClient();
15-
initializeEvents();
1613

17-
client.login(process.env.DISCORD_BOT_TOKEN).catch(Log.error);
14+
client.login(process.env.DISCORD_BOT_TOKEN).catch(error => Log.error(error));
1815

1916
function initializeClient() {
2017
const clientOptions = {
@@ -37,35 +34,7 @@ function initializeClient() {
3734
Partials.User
3835
],
3936
};
40-
return new SapphireClient(clientOptions);
41-
}
42-
43-
// the events handler
44-
async function initializeEvents() {
45-
46-
client.on('error', Log.error);
47-
48-
const eventsPath = new URL('./events', import.meta.url);
49-
const eventsArray = await readdir(eventsPath);
50-
const eventFiles = eventsArray.filter(file => file.endsWith('.js'));
51-
// client.events = new Collection();
52-
eventFiles.forEach(async function(file) {
53-
const filePath = join(eventsPath.toString(), file);
54-
const eventModule = await import(filePath);
55-
const event = await eventModule.default;
56-
// client.events.set(event.name, event);
57-
try {
58-
if (event.once) {
59-
client.once(event.name, (...args) => event.execute(...args, client));
60-
} else {
61-
client.on(event.name, (...args) => event.execute(...args, client));
62-
}
63-
} catch (e) {
64-
// eslint-disable-next-line no-console
65-
console.error('events error:', e);
66-
}
67-
});
68-
return client.events;
37+
return new OverloadClient(clientOptions);
6938
}
7039

7140
// Sentry setup

0 commit comments

Comments
 (0)