feat: add discord_embed handler

This commit is contained in:
Bastien Riviere 2023-09-03 16:46:02 +02:00
parent 64e91cb2d4
commit c832ea4645
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
5 changed files with 95 additions and 0 deletions

View file

@ -11,12 +11,15 @@ type HandlerType int
const (
HandlerFlux HandlerType = iota + 1
HandlerDiscordEmbed
)
func (h HandlerType) String() string {
switch h {
case HandlerFlux:
return "flux"
case HandlerDiscordEmbed:
return "discord_embed"
}
panic("unreachable")
}
@ -148,6 +151,8 @@ func readHandlerType(d *scfg.Directive) (HandlerType, error) {
switch ty {
case "flux":
return HandlerFlux, nil
case "discord_embed":
return HandlerDiscordEmbed, nil
default:
return 0, fmt.Errorf("invalid handler type %q", ty)
}