Skip to content

Commit 64c048e

Browse files
committed
Don't generate images from quotes
1 parent ae24b12 commit 64c048e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

handlers/anonlink.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ func AnonLink(params bot.HandlerParams) error {
3535
return nil
3636
}
3737

38+
const generateAnonQuoteImages = false
39+
3840
func AnonQuote(params bot.HandlerParams) error {
3941
q := model.New(db.DB)
4042
pool := linkpool.New(q, minAge)
@@ -43,14 +45,18 @@ func AnonQuote(params bot.HandlerParams) error {
4345
return err
4446
}
4547

46-
img, err := image.GenerateDALLE(context.TODO(), note.Text.String)
47-
if err != nil {
48+
if generateAnonQuoteImages {
49+
img, err := image.GenerateDALLE(context.TODO(), note.Text.String)
50+
if err != nil {
51+
params.Privmsgf(params.Target, "%s", note.Text.String)
52+
return err
53+
}
54+
55+
params.Privmsgf(params.Target, "%s %s", note.Text.String, img.URL())
56+
} else {
4857
params.Privmsgf(params.Target, "%s", note.Text.String)
49-
return err
5058
}
5159

52-
params.Privmsgf(params.Target, "%s %s", note.Text.String, img.URL())
53-
5460
return nil
5561
}
5662

0 commit comments

Comments
 (0)