Skip to content

Commit

Permalink
fix: Image
Browse files Browse the repository at this point in the history
  • Loading branch information
deanxv committed Jul 3, 2024
1 parent c01fc8c commit 75ae85c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/processmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func processMessageUpdateForOpenAIImage(m *discordgo.MessageUpdate) model.OpenAI
}
}

re := regexp.MustCompile(`]\((https?://\S+)\)`)
re := regexp.MustCompile(`\]\((https?://[^\s\)]+)\)`)
subMatches := re.FindAllStringSubmatch(m.Content, -1)

if len(subMatches) == 0 {
Expand Down Expand Up @@ -191,7 +191,7 @@ func processMessageCreateForOpenAIImage(m *discordgo.MessageCreate) model.OpenAI
}
}

re := regexp.MustCompile(`]\((https?://\S+)\)`)
re := regexp.MustCompile(`\]\((https?://[^\s\)]+)\)`)
subMatches := re.FindAllStringSubmatch(m.Content, -1)

if len(subMatches) == 0 {
Expand Down

0 comments on commit 75ae85c

Please sign in to comment.