@abdarrahmanabdelnasir/relay-node 0.1.12 → 0.1.14

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.
@@ -18,6 +18,10 @@ const botId = getEnv('BOT_ID');
18
18
  const baseUrl = process.env.COMMANDLESS_SERVICE_URL; // Optional - defaults to Commandless backend
19
19
  const hmacSecret = process.env.COMMANDLESS_HMAC_SECRET;
20
20
 
21
+ // Log API key for debugging (first 15 chars only)
22
+ console.log(`[commandless] Using API key: ${apiKey.substring(0, 15)}... (full length: ${apiKey.length})`);
23
+ console.log(`[commandless] Using BOT_ID: ${botId}`);
24
+
21
25
  const client = new Client({
22
26
  intents: [
23
27
  GatewayIntentBits.Guilds,
@@ -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.14",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",