@constatic/base 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/client.js +5 -3
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Constatic Base
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Library with structures and functions for creating modern Discord applications.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
bun install
|
|
7
|
-
```
|
|
5
|
+
It all starts with the bootstrap function.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
```ts
|
|
8
|
+
import { bootstrap } from "@constatic/base";
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
bun run ./src/index.ts
|
|
10
|
+
await bootstrap({ meta: import.meta });
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
⚠️ It is recommended to use the [Constant CLI](https://constatic-docs.vercel.app/pt/docs/discord/start) to generate a project instead of doing it manually.
|
|
14
|
+
|
|
15
|
+
[📚 Read the full documentation here](https://constatic-docs.vercel.app/pt/docs)
|
package/dist/client.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// src/client.ts
|
|
2
|
-
import { Client } from "discord.js";
|
|
2
|
+
import { Client, IntentsBitField, Partials } from "discord.js";
|
|
3
3
|
import { styleText } from "node:util";
|
|
4
4
|
import { ConstaticApp } from "./app.js";
|
|
5
|
+
var defaultIntents = Object.values(IntentsBitField.Flags).filter((t) => typeof t !== "string");
|
|
6
|
+
var defaultPartials = Object.values(Partials).filter((t) => typeof t !== "string");
|
|
5
7
|
function createClient(token, options) {
|
|
6
8
|
const app = ConstaticApp.getInstance();
|
|
7
9
|
const client = new Client({
|
|
8
10
|
...options,
|
|
9
|
-
intents: options.intents ??
|
|
10
|
-
partials: options.partials ??
|
|
11
|
+
intents: options.intents ?? defaultIntents,
|
|
12
|
+
partials: options.partials ?? defaultPartials,
|
|
11
13
|
failIfNotExists: options.failIfNotExists ?? false
|
|
12
14
|
});
|
|
13
15
|
client.token = token;
|
package/dist/version.js
CHANGED