@abdarrahmanabdelnasir/relay-node 0.1.12 → 0.1.13

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.
@@ -13,6 +13,7 @@ export declare class RelayClient {
13
13
  platform: 'discord';
14
14
  name?: string;
15
15
  clientId?: string;
16
+ botId?: number;
16
17
  }): Promise<string | null>;
17
18
  heartbeat(): Promise<void>;
18
19
  sendEvent(event: RelayEvent): Promise<Decision | null>;
@@ -22,9 +22,17 @@ export class RelayClient {
22
22
  this.botId = res.data.botId;
23
23
  return this.botId;
24
24
  }
25
+ // Log error for debugging
26
+ if (!res.ok) {
27
+ console.error(`[commandless] registerBot failed: ${res.status} ${res.error || 'Unknown error'}`);
28
+ }
29
+ else if (!res.data?.botId) {
30
+ console.error(`[commandless] registerBot: response missing botId`, res.data);
31
+ }
25
32
  return null;
26
33
  }
27
- catch {
34
+ catch (err) {
35
+ console.error(`[commandless] registerBot exception:`, err?.message || err);
28
36
  return null;
29
37
  }
30
38
  }
@@ -13,6 +13,7 @@ export declare class RelayClient {
13
13
  platform: 'discord';
14
14
  name?: string;
15
15
  clientId?: string;
16
+ botId?: number;
16
17
  }): Promise<string | null>;
17
18
  heartbeat(): Promise<void>;
18
19
  sendEvent(event: RelayEvent): Promise<Decision | null>;
@@ -25,9 +25,17 @@ class RelayClient {
25
25
  this.botId = res.data.botId;
26
26
  return this.botId;
27
27
  }
28
+ // Log error for debugging
29
+ if (!res.ok) {
30
+ console.error(`[commandless] registerBot failed: ${res.status} ${res.error || 'Unknown error'}`);
31
+ }
32
+ else if (!res.data?.botId) {
33
+ console.error(`[commandless] registerBot: response missing botId`, res.data);
34
+ }
28
35
  return null;
29
36
  }
30
- catch {
37
+ catch (err) {
38
+ console.error(`[commandless] registerBot exception:`, err?.message || err);
31
39
  return null;
32
40
  }
33
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abdarrahmanabdelnasir/relay-node",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",