Add ability to send Telegram notifications silently.

This commit is contained in:
Nikita Lutsenko 2022-11-19 16:10:30 -08:00
parent bc3229828e
commit da16796ec4
3 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,7 @@ class Telegram extends NotificationProvider {
params: {
chat_id: notification.telegramChatID,
text: msg,
disable_notification: notification.telegramSendSilently,
},
});
return okMsg;

View File

@ -28,6 +28,15 @@
<a :href="telegramGetUpdatesURL('withToken')" target="_blank" style="word-break: break-word;">{{ telegramGetUpdatesURL("masked") }}</a>
</p>
</div>
<div class="form-check form-switch">
<input v-model="$parentnotification.telegramSendSilently" class="form-check-input" type="checkbox">
<label class="form-check-label">{{ $t("Send Silently") }}</label>
</div>
<div class="form-text">
{{ $t("telegramSendSilentlyDescription") }}
</div>
</div>
</template>

View File

@ -214,6 +214,8 @@ export default {
"Chat ID": "Chat ID",
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:",
"Send Silently": "Send Silently",
telegramSendSilentlyDescription: "Sends the message silently. Users will receive a notification with no sound.",
"YOUR BOT TOKEN HERE": "YOUR BOT TOKEN HERE",
chatIDNotFound: "Chat ID is not found; please send a message to this bot first",
webhook: "Webhook",