@@ -63,6 +67,9 @@ export default {
components: {
HiddenInput,
},
+ mounted() {
+ this.$parent.notification.telegramServerUrl ||= "https://api.telegram.org";
+ },
methods: {
/**
* Get the URL for telegram updates
@@ -70,6 +77,7 @@ export default {
* @returns {string} formatted URL
*/
telegramGetUpdatesURL(mode = "masked") {
+ let serverUrl = this.$parent.notification.telegramServerUrl;
let token = `<${this.$t("YOUR BOT TOKEN HERE")}>`;
if (this.$parent.notification.telegramBotToken) {
@@ -80,7 +88,7 @@ export default {
}
}
- return `https://api.telegram.org/bot${token}/getUpdates`;
+ return `${serverUrl}/bot${token}/getUpdates`;
},
/**
diff --git a/src/lang/en.json b/src/lang/en.json
index e215f1031..fd5edaa7a 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -423,6 +423,8 @@
"telegramProtectContentDescription": "If enabled, the bot messages in Telegram will be protected from forwarding and saving.",
"supportTelegramChatID": "Support Direct Chat / Group / Channel's Chat ID",
"wayToGetTelegramChatID": "You can get your chat ID by sending a message to the bot and going to this URL to view the chat_id:",
+ "telegramServerUrl": "(Optional) Server Url",
+ "telegramServerUrlDescription": "Telegram custom bot api server url. Defaults to https://api.telegram.org if empty.",
"YOUR BOT TOKEN HERE": "YOUR BOT TOKEN HERE",
"chatIDNotFound": "Chat ID is not found; please send a message to this bot first",
"disableCloudflaredNoAuthMsg": "You are in No Auth mode, a password is not required.",