Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions providers/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func (agent *DiscordProvider) Reply(threadId string, message string, option mode
}

func (agent *DiscordProvider) setup(env *config.Config) error {
if env == nil {
return fmt.Errorf("config is required")
}
if env.WebHookURL == "" {
return fmt.Errorf("webhook_url is required for Discord provider")
}
agent.config = env
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions providers/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ func (agent *GoogleProvider) Reply(threadId string, message string, option model
}

func (agent *GoogleProvider) setup(env *config.Config) error {
if env == nil {
return fmt.Errorf("config is required")
}
if env.WebHookURL == "" {
return fmt.Errorf("webhook_url is required for Google provider")
}
agent.config = env
return nil
}
Expand Down
9 changes: 9 additions & 0 deletions providers/gotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func (agent *GotifyProvider) Reply(threadId string, message string, option model
}

func (agent *GotifyProvider) setup(env *config.Config) error {
if env == nil {
return fmt.Errorf("config is required")
}
if env.GotifyURL == "" {
return fmt.Errorf("gotify_url is required for Gotify provider")
}
if env.GotifyToken == "" {
return fmt.Errorf("gotify_token is required for Gotify provider")
}
agent.config = env
return nil
}
Expand Down
Loading