mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
Merge pull request #2595 from tminei/telegram_test
Added a more telegram notifications options
This commit is contained in:
commit
8e3dd4202f
4 changed files with 16 additions and 2 deletions
|
@ -755,7 +755,7 @@ class Monitor extends BeanModel {
|
|||
await R.store(bean);
|
||||
|
||||
log.debug("monitor", `[${this.name}] prometheus.update`);
|
||||
this.prometheus.update(bean, tlsInfo);
|
||||
this.prometheus?.update(bean, tlsInfo);
|
||||
|
||||
previousBeat = bean;
|
||||
|
||||
|
@ -840,7 +840,7 @@ class Monitor extends BeanModel {
|
|||
clearTimeout(this.heartbeatInterval);
|
||||
this.isStop = true;
|
||||
|
||||
this.prometheus.remove();
|
||||
this.prometheus?.remove();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@ class Telegram extends NotificationProvider {
|
|||
chat_id: notification.telegramChatID,
|
||||
text: msg,
|
||||
disable_notification: notification.telegramSendSilently ?? false,
|
||||
protect_content: notification.telegramProtectContent ?? false,
|
||||
};
|
||||
if (notification.telegramMessageThreadID) {
|
||||
params.message_thread_id = notification.telegramMessageThreadID;
|
||||
|
|
|
@ -42,6 +42,17 @@
|
|||
{{ $t("telegramSendSilentlyDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check form-switch">
|
||||
<input v-model="$parent.notification.telegramProtectContent" class="form-check-input" type="checkbox">
|
||||
<label class="form-check-label">{{ $t("telegramProtectContent") }}</label>
|
||||
</div>
|
||||
|
||||
<div class="form-text">
|
||||
{{ $t("telegramProtectContentDescription") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -365,6 +365,8 @@
|
|||
"telegramMessageThreadIDDescription": "Optional Unique identifier for the target message thread (topic) of the forum; for forum supergroups only",
|
||||
"telegramSendSilently": "Send Silently",
|
||||
"telegramSendSilentlyDescription": "Sends the message silently. Users will receive a notification with no sound.",
|
||||
"telegramProtectContent": "Protect Forwarding/Saving",
|
||||
"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:",
|
||||
"YOUR BOT TOKEN HERE": "YOUR BOT TOKEN HERE",
|
||||
|
|
Loading…
Reference in a new issue