diff --git a/handlers.go b/handlers.go index 265e55e..213b5a7 100644 --- a/handlers.go +++ b/handlers.go @@ -22,6 +22,7 @@ func addHandlers(b *bot.Bot) { b.Handle(`^!pipehealth\b`, handlers.AnonStatus) b.Handle(`(https?://\S+)`, handlers.Link) b.Handle(`^!day\b`, day.NationalDay) + b.Handle(`^!dayi\b`, day.Dayi) b.Handle(`^!week`, day.NationalWeek) b.Handle(`^!month`, day.NationalMonth) b.Handle(`^!refs`, day.NationalRefs) diff --git a/handlers/day/day.go b/handlers/day/day.go index cbc9c88..e54b2e2 100644 --- a/handlers/day/day.go +++ b/handlers/day/day.go @@ -92,12 +92,21 @@ func dayImage(cmd string) (*image.GeneratedImage, error) { prompt := fmt.Sprintf("a scene incorporating themes from: %s", strings.Join(days, ",")) gi, err := image.Generate(context.Background(), prompt) if err != nil { - return nil, err + return nil, fmt.Errorf("prompt: %s: %w", prompt, err) } return gi, nil } +func Dayi(params bot.HandlerParams) error { + img, err := dayImage(dayCmd) + if err != nil { + return err + } + params.Privmsgf(params.Target, "Today's image: %s", img.URL()) + return nil +} + func Image(params bot.HandlerParams) error { prompt := params.Matches[1] gi, err := image.Generate(context.Background(), prompt)