Migrate deployment to Gitea Actions and Portainer
Build and Push Container / docker (push) Successful in 24m19s

This commit is contained in:
2026-03-22 11:43:22 -08:00
parent c611065fde
commit 3b0bf0866a
10 changed files with 178 additions and 95 deletions
+7 -9
View File
@@ -5,8 +5,9 @@ import (
"os"
"regexp"
"strings"
neturl "net/url"
"github.com/bwmarrin/discordgo"
"github.com/dustinpianalto/discordgo"
)
func CleanAmazonURLs(s *discordgo.Session, message *discordgo.MessageCreate) {
@@ -25,14 +26,11 @@ func CleanAmazonURLs(s *discordgo.Session, message *discordgo.MessageCreate) {
if len(urls) != 0 {
for _, url := range urls {
if strings.Contains(url, "ref=") || strings.Contains(url, "?") {
parts := strings.Split(url, "/")
new := strings.Join(parts[:len(parts)-1], "/")
if strings.Contains(new, "ref=") {
parts = strings.Split(new, "ref=")
new = parts[0]
}
content = strings.ReplaceAll(content, url, new)
u, _ := neturl.Parse(url)
u.RawQuery = ""
u.Fragment = ""
if ( url != u.String() ) {
content = strings.ReplaceAll(content, url, u.String())
}
}
_, err := sendWebhook(s, message, message.ChannelID, content)