Console logs and region var

This commit is contained in:
Atridad Lahiji 2024-01-20 01:39:52 -07:00
parent 4469788d91
commit 7fbfb3fd26
No known key found for this signature in database
3 changed files with 9 additions and 4 deletions

View file

@ -2,4 +2,10 @@
DISCORD_TOKEN=""
REPLICATE_API_TOKEN=""
# Comma separated
COOLDOWN_ALLOW_LIST=""
COOLDOWN_ALLOW_LIST=""
# S3
BUCKET_NAME=
AWS_ENDPOINT_URL_S3=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=

View file

@ -12,7 +12,6 @@ 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
@ -21,9 +20,10 @@ func UploadToS3(filePath string) (*s3manager.UploadOutput, error) {
endpoint := os.Getenv("AWS_ENDPOINT_URL_S3")
accessKeyID := os.Getenv("AWS_ACCESS_KEY_ID")
secretAccessKey := os.Getenv("AWS_SECRET_ACCESS_KEY")
region := os.Getenv("AWS_REGION")
sess, err := session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
Region: &region,
Credentials: credentials.NewStaticCredentials(
accessKeyID,
secretAccessKey,

View file

@ -189,7 +189,6 @@ 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)