✨ feat: Add Telegram push hook functionality and configuration options

- Add "tgChatId" and "tgBotToken" fields to configuration files
- Modify "config.go" to include new configuration fields
- Implement Telegram push hook functionality in "telegram_push.go"
- Add test file "telegram_push_test.go" to test Telegram push hook functionality
This commit is contained in:
J3n5en committed 2023-08-28 14:38:09 +08:00
1 parent 6afd95d82c
commit f2a642bf79
7 files changed
+127

No files matched your search

+2
View File
@@ -12,6 +12,8 @@
"weChatPushSecret": "",
"weChatPushTemplateId": "",
"weChatPushUserId": "",
"tgChatId": "",
"tgBotToken": "",
"isInit": true,
"httpsEnabled": 2
}
+2
View File
@@ -24,6 +24,8 @@ type Config struct {
WeChatPushSecret string `json:"weChatPushSecret"`
WeChatPushTemplateId string `json:"weChatPushTemplateId"`
WeChatPushUserId string `json:"weChatPushUserId"`
TgBotToken string `json:"tgBotToken"`
TgChatId string `json:"tgChatId"`
IsInit bool `json:"isInit"`
HttpsEnabled int `json:"httpsEnabled"` //后台页面是否启用https,0默认(启用),1启用,2不启用
Tables map[string]string `json:"-"`
+2
View File
@@ -12,6 +12,8 @@
"weChatPushSecret": "",
"weChatPushTemplateId": "",
"weChatPushUserId": "",
"tgChatId": "",
"tgBotToken": "",
"isInit": true,
"httpsEnabled": 2
}
+2
View File
@@ -12,6 +12,8 @@
"weChatPushSecret": "",
"weChatPushTemplateId": "",
"weChatPushUserId": "",
"tgChatId": "",
"tgBotToken": "",
"isInit": true,
"httpsEnabled": 2
}