@poolzin/pool-bot 2026.4.14 → 2026.4.15

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.4.14",
2
+ "version": "2026.4.15",
3
3
  "commit": "4e1f8d4b27c26618d3a69049dbe44698929a6ba8",
4
- "builtAt": "2026-03-26T02:27:19.719Z"
4
+ "builtAt": "2026-03-26T03:31:24.194Z"
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bot-native-command-menu.d.ts","sourceRoot":"","sources":["../../src/telegram/bot-native-command-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAKlC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,KAAK,EAAE,yBAAyB,EAAE,CAAC;IACnC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC/B,GAAG;IAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAiCxD;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG;IACF,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,a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AO,EAAE,UAAU,CAAC;IACpB,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;CAC3C,GAAG,IAAI,CA0BP"}
@@ -32,12 +32,31 @@ export function buildPluginTelegramMenuCommands(params) {
32
32
  }
33
33
  return { commands, issues };
34
34
  }
35
+ // Telegram enforces an undocumented ~5300 character limit on the total of all
36
+ // command names + descriptions combined (not just the 100-command count limit).
37
+ // We cap total chars to stay safely under this limit.
38
+ const TELEGRAM_MAX_TOTAL_CHARS = 5000;
35
39
  export function buildCappedTelegramMenuCommands(params) {
36
40
  const { allCommands } = params;
37
41
  const maxCommands = params.maxCommands ?? TELEGRAM_MAX_COMMANDS;
38
42
  const totalCommands = allCommands.length;
39
- const overflowCount = Math.max(0, totalCommands - maxCommands);
40
- const commandsToRegister = allCommands.slice(0, maxCommands);
43
+ // First, truncate descriptions so the total fits under the character limit.
44
+ let remainingChars = TELEGRAM_MAX_TOTAL_CHARS;
45
+ const capped = [];
46
+ for (const cmd of allCommands) {
47
+ const nameCost = cmd.command.length;
48
+ const minDescCost = Math.min(cmd.description.length, 3); // keep at least 3 chars
49
+ if (remainingChars - nameCost - minDescCost < 0)
50
+ break;
51
+ const descBudget = Math.min(cmd.description.length, remainingChars - nameCost);
52
+ const desc = descBudget < cmd.description.length
53
+ ? cmd.description.slice(0, Math.max(0, descBudget - 1)) + "\u2026"
54
+ : cmd.description;
55
+ capped.push({ command: cmd.command, description: desc });
56
+ remainingChars -= nameCost + desc.length;
57
+ }
58
+ const overflowCount = Math.max(0, totalCommands - capped.length);
59
+ const commandsToRegister = capped.slice(0, maxCommands);
41
60
  return { commandsToRegister, totalCommands, maxCommands, overflowCount };
42
61
  }
43
62
  export function syncTelegramMenuCommands(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolzin/pool-bot",
3
- "version": "2026.4.14",
3
+ "version": "2026.4.15",
4
4
  "description": "🎱 Pool Bot - AI assistant with PLCODE integrations",
5
5
  "keywords": [],
6
6
  "license": "MIT",