feat: add incoming webhook API support with configurable endpoints
- Implemented the incoming webhook API to handle alerts from external applications. - Added configuration options for webhook listening address, port, and endpoints in config.go. - Created WebhookReceiverConfig and WebhookEndpointConfig structures to manage webhook settings. - Developed WebhookHandler to process incoming requests, validate tokens, and deliver alerts to specified channels. - Enhanced existing controller interfaces to support alert delivery. - Updated message rendering to respect Markdown settings for different channels. - Added tests for webhook functionality and ensured proper error handling.
This commit is contained in:
@@ -43,10 +43,10 @@ func (m *Manager) Trigger(cmd Command, trustedGroups, admins []string, listenMet
|
||||
// RouteCommand processes a parsed bot command and returns the response text.
|
||||
// The actual command execution for every pipe is unified here.
|
||||
func (m *Manager) RouteCommand(cmd Command) (string, error) {
|
||||
if cmd.Source == "telegram"{
|
||||
if cmd.Source == "telegram" {
|
||||
switch cmd.Command {
|
||||
case "start":
|
||||
return telegram_handleStart()
|
||||
return telegram_handleStart(cmd)
|
||||
}
|
||||
}
|
||||
switch cmd.Command {
|
||||
|
||||
Reference in New Issue
Block a user