fix webhook url
This commit is contained in:
@@ -40,12 +40,13 @@ func CreateAddon(c *gin.Context) {
|
||||
}
|
||||
|
||||
lastWebhookTime = time.Now()
|
||||
oldNbr := nbrOfUnsentWebhooks
|
||||
nbrOfUnsentWebhooks = 0
|
||||
|
||||
go func() {
|
||||
webhookURL := initializers.ScraperWebhook
|
||||
if webhookURL != "" {
|
||||
text := fmt.Sprintf("New %d addons found\nLast: %s (%s).", nbrOfUnsentWebhooks, addon.ID, addon.Name)
|
||||
text := fmt.Sprintf("New %d addons found\nLast: %s (%s).", oldNbr, addon.ID, addon.Name)
|
||||
colour := 2228479
|
||||
size := fmt.Sprintf("%.2f MB", float64(addon.CurrentVersionSize)/1_000_000)
|
||||
|
||||
@@ -75,7 +76,7 @@ func CreateAddon(c *gin.Context) {
|
||||
Embeds: []models.CustomEmbed{myEmbed},
|
||||
}
|
||||
|
||||
err := SendCustomWebhook(initializers.DiscordWebhook, myHook)
|
||||
err := SendCustomWebhook(webhookURL, myHook)
|
||||
if err != nil {
|
||||
fmt.Println("Error sending webhook:", err)
|
||||
}
|
||||
@@ -133,7 +134,7 @@ func CreateAddon(c *gin.Context) {
|
||||
Embeds: []models.CustomEmbed{myEmbed},
|
||||
}
|
||||
|
||||
err := SendCustomWebhook(initializers.DiscordWebhook, myHook)
|
||||
err := SendCustomWebhook(webhookURL, myHook)
|
||||
if err != nil {
|
||||
fmt.Println("Error sending webhook:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user