tripstorekrabi-shared 1.22.8 → 1.22.9

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/telegram.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.22.8",
3
+ "version": "1.22.9",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "dayjs": "^1.11.19",
21
- "libphonenumber-js": "^1.12.31",
21
+ "libphonenumber-js": "^1.12.33",
22
22
  "nanoid": "^5.1.6"
23
23
  },
24
24
  "scripts": {
package/telegram.js CHANGED
@@ -16,7 +16,7 @@ export async function sendTelegramMessage(message, options = {}) {
16
16
 
17
17
  if (!BOT_TOKEN || !CHAT_ID) {
18
18
  console.error("FATAL: Telegram secrets are not configured in options or the environment.");
19
- return;
19
+ return false;
20
20
  }
21
21
 
22
22
  let finalMessage = `${prefix} ${message}`.trim();
@@ -48,10 +48,13 @@ export async function sendTelegramMessage(message, options = {}) {
48
48
  const errorBody = await res.text();
49
49
  console.error(`Failed to send Telegram message: HTTP Status ${res.status} ${res.statusText}`);
50
50
  console.error('Telegram API Detailed Error:', errorBody);
51
+ return false;
51
52
  } else {
52
53
  console.log('Telegram message sent successfully.');
54
+ return true;
53
55
  }
54
56
  } catch (e) {
55
57
  console.error('An error occurred while trying to send a Telegram message:', e);
58
+ return false;
56
59
  }
57
60
  }