dsh-tg-bridge 1.12.0 → 1.12.1

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/bridge.mjs +9 -1
  2. package/package.json +1 -1
package/bridge.mjs CHANGED
@@ -329,7 +329,15 @@ function providerKeys(cfg) {
329
329
  function findToken() {
330
330
  const env = (process.env.DSH_TELEGRAM_BOT_TOKEN || '').trim();
331
331
  if (env) return env;
332
- for (const name of ['DSH_TELEGRAM_BOT_TOKEN', 'DSH_TELEGRAM_BOT_TOKEN_3278A97027814C501779F5E2']) {
332
+ // The suffixed name carries a random id of the machine that created the
333
+ // secret (DSH_TELEGRAM_BOT_TOKEN_<hex>), so it must not be spelled out here:
334
+ // any install is free to carry its own suffix. Try the plain name first, then
335
+ // whatever suffixed variants the credentials file actually holds.
336
+ const suffixes = [];
337
+ try {
338
+ for (const m of readFileSync(CRED, 'utf8').matchAll(/^\s*(DSH_TELEGRAM_BOT_TOKEN_[A-Z0-9_]+):/gm)) suffixes.push(m[1]);
339
+ } catch {}
340
+ for (const name of ['DSH_TELEGRAM_BOT_TOKEN', ...suffixes]) {
333
341
  try {
334
342
  const value = readSecret(name);
335
343
  if (value) return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tg-bridge",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Telegram bridge for DeepSeek Harness: text, voice, photos and project-per-topic sessions without opening the desktop app",
5
5
  "type": "module",
6
6
  "main": "plugin-bridge.mjs",