diff --git a/discord/processmessage.go b/discord/processmessage.go index 67f31d6f..91029803 100644 --- a/discord/processmessage.go +++ b/discord/processmessage.go @@ -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 { @@ -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 {