Merge pull request #37 from nils1323/allow-chat-telegram-chat_ids

Allow chat_ids for telegram notifications
pull/1081/head
Adam 2021-09-14 13:57:12 +01:00 committed by GitHub
commit 75033f1892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -282,7 +282,7 @@ export default {
this.notifier.form.forEach((f) => { this.notifier.form.forEach((f) => {
let field = f.field.toLowerCase() let field = f.field.toLowerCase()
let val = this.notifier[field] let val = this.notifier[field]
if (this.isNumeric(val)) { if (this.isNumeric(val) && this.form.method!='telegram') {
val = parseInt(val) val = parseInt(val)
} }
this.form[field] = val this.form[field] = val
@ -304,7 +304,7 @@ export default {
this.notifier.form.forEach((f) => { this.notifier.form.forEach((f) => {
let field = f.field.toLowerCase() let field = f.field.toLowerCase()
let val = this.notifier[field] let val = this.notifier[field]
if (this.isNumeric(val)) { if (this.isNumeric(val) && this.form.method!='telegram') {
val = parseInt(val) val = parseInt(val)
} }
this.form[field] = val this.form[field] = val

View File

@ -52,8 +52,8 @@ var Telegram = &telegram{&notifications.Notification{
}, { }, {
Type: "text", Type: "text",
Title: "Channel", Title: "Channel",
Placeholder: "@statping_channel", Placeholder: "@statping_channel/-123123512312",
SmallText: "Insert your Telegram Channel including the @ symbol. The bot will need to be an administrator of this channel.", SmallText: "Insert your Telegram Channel including the @ symbol. The bot will need to be an administrator of this channel. You can also supply a chat_id.",
DbField: "var1", DbField: "var1",
Required: true, Required: true,
}}}, }}},