Migrate deployment to Gitea Actions and Portainer
Build and Push Container / docker (push) Successful in 24m19s
Build and Push Container / docker (push) Successful in 24m19s
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/prepbot/internal/discord_utils"
|
||||
"github.com/dustinpianalto/discordgo"
|
||||
"gitea.wayfinderak.com/wayfinderak/prepbot/internal/discord_utils"
|
||||
)
|
||||
|
||||
var joinChannelID = "768571410133418037"
|
||||
@@ -44,8 +44,6 @@ func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMember
|
||||
Inline: false,
|
||||
}
|
||||
|
||||
joinTime, _ := member.JoinedAt.Parse()
|
||||
|
||||
embed := &discordgo.MessageEmbed{
|
||||
Title: title,
|
||||
Description: fmt.Sprintf("%v (%v) Has Joined the Server", member.User.Mention(), member.User.ID),
|
||||
@@ -53,9 +51,9 @@ func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMember
|
||||
Thumbnail: thumb,
|
||||
Footer: &discordgo.MessageEmbedFooter{
|
||||
Text: fmt.Sprintf("Current Member Count: %v", guild.MemberCount),
|
||||
IconURL: guild.IconURL(),
|
||||
IconURL: guild.IconURL("1024"),
|
||||
},
|
||||
Timestamp: joinTime.Format(time.RFC3339),
|
||||
Timestamp: member.JoinedAt.Format(time.RFC3339),
|
||||
Fields: []*discordgo.MessageEmbedField{field},
|
||||
}
|
||||
s.ChannelMessageSendEmbed(joinChannelID, embed)
|
||||
@@ -117,7 +115,7 @@ func OnGuildMemberRemoveLogging(s *discordgo.Session, member *discordgo.GuildMem
|
||||
Thumbnail: thumb,
|
||||
Footer: &discordgo.MessageEmbedFooter{
|
||||
Text: fmt.Sprintf("Current Member Count: %v", guild.MemberCount),
|
||||
IconURL: guild.IconURL(),
|
||||
IconURL: guild.IconURL("1024"),
|
||||
},
|
||||
Timestamp: timeNow.Format(time.RFC3339),
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user