summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/repo_form.go12
-rw-r--r--modules/setting/webhook.go2
2 files changed, 13 insertions, 1 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go
index 990a94dd63..d37a5b94d8 100644
--- a/modules/auth/repo_form.go
+++ b/modules/auth/repo_form.go
@@ -263,6 +263,18 @@ func (f *NewDingtalkHookForm) Validate(ctx *macaron.Context, errs binding.Errors
return validate(errs, ctx.Data, f, ctx.Locale)
}
+// NewTelegramHookForm form for creating telegram hook
+type NewTelegramHookForm struct {
+ BotToken string `binding:"Required"`
+ ChatID string `binding:"Required"`
+ WebhookForm
+}
+
+// Validate validates the fields
+func (f *NewTelegramHookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+ return validate(errs, ctx.Data, f, ctx.Locale)
+}
+
// .___
// | | ______ ________ __ ____
// | |/ ___// ___/ | \_/ __ \
diff --git a/modules/setting/webhook.go b/modules/setting/webhook.go
index 741963e545..0d91e7d9e7 100644
--- a/modules/setting/webhook.go
+++ b/modules/setting/webhook.go
@@ -25,6 +25,6 @@ func newWebhookService() {
Webhook.QueueLength = sec.Key("QUEUE_LENGTH").MustInt(1000)
Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5)
Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool()
- Webhook.Types = []string{"gitea", "gogs", "slack", "discord", "dingtalk"}
+ Webhook.Types = []string{"gitea", "gogs", "slack", "discord", "dingtalk", "telegram"}
Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10)
}