@fre4x/telegram 1.1.6 → 1.1.7

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/dist/index.js +7 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28698,7 +28698,7 @@ function getStatePath() {
28698
28698
  var window = new JSDOM("").window;
28699
28699
  var DOMPurify = createDOMPurify(window);
28700
28700
  var IS_MOCK = process.env.MOCK === "true" || process.env.TELEGRAM_MOCK === "true";
28701
- var botToken = process.env.TELEGRAM_BOT_TOKEN;
28701
+ var botToken = process.env.TELEGRAM_BOT_TOKEN || process.env.BOT_TOKEN;
28702
28702
  var MAX_TOKEN_REDACT_LENGTH = 256;
28703
28703
  function redactBotToken(message) {
28704
28704
  if (!botToken || !message.includes(botToken)) {
@@ -28710,8 +28710,9 @@ function redactBotToken(message) {
28710
28710
  const escapedToken = botToken.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
28711
28711
  return message.replace(new RegExp(escapedToken, "g"), "[REDACTED_TOKEN]");
28712
28712
  }
28713
- var allowedUserId = process.env.ALLOWED_USER_ID;
28714
- var allowedRecipients = process.env.ALLOWED_RECIPIENTS?.split(",").map((id) => id.trim()) || [];
28713
+ var allowedUserId = process.env.ALLOWED_USER_ID || process.env.TELEGRAM_ALLOWED_USER_ID || process.env.TELEGRAM_CHAT_ID || process.env.CHAT_ID;
28714
+ var rawAllowedRecipients = process.env.ALLOWED_RECIPIENTS || process.env.TELEGRAM_ALLOWED_RECIPIENTS;
28715
+ var allowedRecipients = rawAllowedRecipients?.split(",").map((id) => id.trim()).filter(Boolean) || [];
28715
28716
  var enableRecipientWhitelist = process.env.ENABLE_RECIPIENT_WHITELIST === "true";
28716
28717
  var originalError = console.error;
28717
28718
  console.error = (...args) => {
@@ -29563,6 +29564,9 @@ async function run() {
29563
29564
  const transport = new StdioServerTransport();
29564
29565
  await server.connect(transport);
29565
29566
  console.error("Telegram MCP Server running on stdio");
29567
+ if (!IS_MOCK && bot) {
29568
+ void discoverChatsFromApi();
29569
+ }
29566
29570
  }
29567
29571
  process.on("SIGINT", () => {
29568
29572
  stopChannelPolling();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fre4x/telegram",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Telegram MCP server implementing Claude Code Channels for bidirectional communication and remote permission relay.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",