nyx-bot-client 0.0.5 → 0.0.6
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/biome.json +1 -1
- package/bun.lock +11 -10
- package/nyx-client.ts +12 -9
- package/package.json +2 -2
package/biome.json
CHANGED
package/bun.lock
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 0,
|
|
3
4
|
"workspaces": {
|
|
4
5
|
"": {
|
|
5
6
|
"name": "nyx-bot-client",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@biomejs/biome": "^2.3.
|
|
8
|
+
"@biomejs/biome": "^2.3.6",
|
|
8
9
|
"@types/node": "^24.10.1",
|
|
9
10
|
"dotenv": "^17.2.3",
|
|
10
11
|
"kysely": "^0.28.8",
|
|
@@ -21,23 +22,23 @@
|
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
"packages": {
|
|
24
|
-
"@biomejs/biome": ["@biomejs/biome@2.3.
|
|
25
|
+
"@biomejs/biome": ["@biomejs/biome@2.3.6", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.6", "@biomejs/cli-darwin-x64": "2.3.6", "@biomejs/cli-linux-arm64": "2.3.6", "@biomejs/cli-linux-arm64-musl": "2.3.6", "@biomejs/cli-linux-x64": "2.3.6", "@biomejs/cli-linux-x64-musl": "2.3.6", "@biomejs/cli-win32-arm64": "2.3.6", "@biomejs/cli-win32-x64": "2.3.6" }, "bin": { "biome": "bin/biome" } }, "sha512-oqUhWyU6tae0MFsr/7iLe++QWRg+6jtUhlx9/0GmCWDYFFrK366sBLamNM7D9Y+c7YSynUFKr8lpEp1r6Sk7eA=="],
|
|
25
26
|
|
|
26
|
-
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.
|
|
27
|
+
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-P4JWE5d8UayBxYe197QJwyW4ZHp0B+zvRIGCusOm1WbxmlhpAQA1zEqQuunHgSIzvyEEp4TVxiKGXNFZPg7r9Q=="],
|
|
27
28
|
|
|
28
|
-
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.
|
|
29
|
+
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-I4rTebj+F/L9K93IU7yTFs8nQ6EhaCOivxduRha4w4WEZK80yoZ8OAdR1F33m4yJ/NfUuTUbP/Wjs+vKjlCoWA=="],
|
|
29
30
|
|
|
30
|
-
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.
|
|
31
|
+
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-JjYy83eVBnvuINZiqyFO7xx72v8Srh4hsgaacSBCjC22DwM6+ZvnX1/fj8/SBiLuUOfZ8YhU2pfq2Dzakeyg1A=="],
|
|
31
32
|
|
|
32
|
-
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.
|
|
33
|
+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-oK1NpIXIixbJ/4Tcx40cwiieqah6rRUtMGOHDeK2ToT7yUFVEvXUGRKqH0O4hqZ9tW8TcXNZKfgRH6xrsjVtGg=="],
|
|
33
34
|
|
|
34
|
-
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.
|
|
35
|
+
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.6", "", { "os": "linux", "cpu": "x64" }, "sha512-ZjPXzy5yN9wusIoX+8Zp4p6cL8r0NzJCXg/4r1KLVveIPXd2jKVlqZ6ZyzEq385WwU3OX5KOwQYLQsOc788waQ=="],
|
|
35
36
|
|
|
36
|
-
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.
|
|
37
|
+
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.6", "", { "os": "linux", "cpu": "x64" }, "sha512-QvxB8GHQeaO4FCtwJpJjCgJkbHBbWxRHUxQlod+xeaYE6gtJdSkYkuxdKAQUZEOIsec+PeaDAhW9xjzYbwmOFA=="],
|
|
37
38
|
|
|
38
|
-
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.
|
|
39
|
+
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-YM7hLHpwjdt8R7+O2zS1Vo2cKgqEeptiXB1tWW1rgjN5LlpZovBVKtg7zfwfRrFx3i08aNZThYpTcowpTlczug=="],
|
|
39
40
|
|
|
40
|
-
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.
|
|
41
|
+
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.6", "", { "os": "win32", "cpu": "x64" }, "sha512-psgNEYgMAobY5h+QHRBVR9xvg2KocFuBKm6axZWB/aD12NWhQjiVFQUjV6wMXhlH4iT0Q9c3yK5JFRiDC/rzHA=="],
|
|
41
42
|
|
|
42
43
|
"@types/bun": ["@types/bun@1.2.17", "", { "dependencies": { "bun-types": "1.2.17" } }, "sha512-l/BYs/JYt+cXA/0+wUhulYJB6a6p//GTPiJ7nV+QHa8iiId4HZmnu/3J/SowP5g0rTiERY2kfGKXEK5Ehltx4Q=="],
|
|
43
44
|
|
package/nyx-client.ts
CHANGED
|
@@ -21,6 +21,7 @@ type NyxConfig = {
|
|
|
21
21
|
redis?: {
|
|
22
22
|
host?: string;
|
|
23
23
|
port?: number;
|
|
24
|
+
skip?: boolean;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
|
|
@@ -34,10 +35,6 @@ class NyxClient {
|
|
|
34
35
|
private redis: RedisClient | undefined;
|
|
35
36
|
|
|
36
37
|
public async initialize(config: NyxConfig) {
|
|
37
|
-
this.redis = new RedisClient(
|
|
38
|
-
`redis://${config.redis?.host ?? "127.0.0.1"}:${config.redis?.port ?? 6379}`,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
38
|
this.botConfig = z
|
|
42
39
|
.object({
|
|
43
40
|
username: z.string().nonempty(),
|
|
@@ -50,11 +47,17 @@ class NyxClient {
|
|
|
50
47
|
this.injections = config.injections;
|
|
51
48
|
this.benchmark = config.benchmark;
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
if (!config.redis?.skip) {
|
|
51
|
+
this.redis = new RedisClient(
|
|
52
|
+
`redis://${config.redis?.host ?? "127.0.0.1"}:${config.redis?.port ?? 6379}`,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
await this.redis.connect();
|
|
56
|
+
this.redis.subscribe(
|
|
57
|
+
this.botConfig.username,
|
|
58
|
+
this.handleUpdateRequest.bind(this),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
58
61
|
|
|
59
62
|
config.onStartup?.();
|
|
60
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nyx-bot-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"typescript": "^5"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@biomejs/biome": "^2.3.
|
|
13
|
+
"@biomejs/biome": "^2.3.6",
|
|
14
14
|
"@types/node": "^24.10.1",
|
|
15
15
|
"dotenv": "^17.2.3",
|
|
16
16
|
"kysely": "^0.28.8",
|