@spectrum-ts/telegram 9.1.0 → 9.3.0
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.
- package/dist/index.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -110,16 +110,23 @@ const getChatDisplayName = async (config, chatId) => {
|
|
|
110
110
|
*/
|
|
111
111
|
const TELEGRAM_PLATFORM = "telegram";
|
|
112
112
|
const configSchema = z.object({
|
|
113
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Bot token from @BotFather (outbound API calls + media downloads). Falls back
|
|
115
|
+
* to `SPECTRUM_TELEGRAM_BOT_TOKEN` when omitted (explicit config wins).
|
|
116
|
+
*/
|
|
114
117
|
botToken: z.string().regex(/^\d+:[A-Za-z0-9_-]+$/, "botToken must be in the form '<id>:<token>'"),
|
|
115
118
|
/**
|
|
116
119
|
* The `secret_token` passed to `setWebhook`. When present, inbound webhooks
|
|
117
120
|
* are verified against the `X-Telegram-Bot-Api-Secret-Token` header; when
|
|
118
121
|
* omitted, the check is skipped. Telegram does not HMAC-sign the body, so
|
|
119
|
-
* this shared token is the only inbound authentication.
|
|
122
|
+
* this shared token is the only inbound authentication. Falls back to
|
|
123
|
+
* `SPECTRUM_TELEGRAM_WEBHOOK_SECRET` when omitted.
|
|
120
124
|
*/
|
|
121
125
|
webhookSecret: z.string().regex(/^[A-Za-z0-9_-]{1,256}$/).optional(),
|
|
122
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Override the Bot API base URL. Precedence is explicit config >
|
|
128
|
+
* `SPECTRUM_TELEGRAM_BASE_URL` > the `https://api.telegram.org` default.
|
|
129
|
+
*/
|
|
123
130
|
baseUrl: z.url().default("https://api.telegram.org")
|
|
124
131
|
});
|
|
125
132
|
/**
|