diff --git a/lib/replicate.go b/lib/replicate.go index 001c6a9..eb3d44d 100644 --- a/lib/replicate.go +++ b/lib/replicate.go @@ -102,14 +102,7 @@ func ReplicateImageGeneration(prompt string, filename string) (*bytes.Buffer, er } // Save image to a temporary file - var tmpfile *os.File - var err error - - if filename != "" { - tmpfile, err = os.CreateTemp("", filename) - } else { - tmpfile, err = os.CreateTemp("", "image.*.jpg") - } + tmpfile, err := os.Create(filename) if err != nil { log.Fatal(err) diff --git a/lib/s3.go b/lib/s3.go index a2682a4..51cc428 100644 --- a/lib/s3.go +++ b/lib/s3.go @@ -12,6 +12,7 @@ import ( func UploadToS3(filePath string) (*s3manager.UploadOutput, error) { bucket := os.Getenv("BUCKET_NAME") + fmt.Println("The filepath is: ", filePath) if bucket == "" { fmt.Println("No S3 bucket specified, skipping upload.") return nil, nil diff --git a/main.go b/main.go index 7a3b950..72fc607 100644 --- a/main.go +++ b/main.go @@ -189,6 +189,7 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In // Concatenate clean username and timestamp to form filename filename := data.Event.Sender().Username + "_" + timestamp + ".jpg" + fmt.Println("The filename is: ", filename) imageFile, err := lib.ReplicateImageGeneration(options.Prompt, filename)