hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/internal/bot
diff options
context:
space:
mode:
Diffstat (limited to 'internal/bot')
-rw-r--r--internal/bot/bot.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/internal/bot/bot.go b/internal/bot/bot.go
index 48e395b..39fd00b 100644
--- a/internal/bot/bot.go
+++ b/internal/bot/bot.go
@@ -114,17 +114,21 @@ func checkMods(cfg *config.Config, client *modrinth.Client) report {
newCache := config.Cache{}
var rep report
- for _, slug := range cfg.ModrinthMods {
- versions, err := client.GetVersions(slug)
+ for _, mod := range cfg.ModrinthMods {
+ if mod.Pinned() {
+ continue
+ }
+
+ versions, err := client.GetVersions(mod.Slug)
if err != nil {
- log.Printf("[Modrinth] failed for %s: %v", slug, err)
+ log.Printf("[Modrinth] failed for %s: %v", mod.Slug, err)
continue
}
latest := modrinth.LatestVersion(versions)
compatible := modrinth.CompatibleVersion(versions, cfg.MinecraftVersion, "")
- cached := cache[slug]
+ cached := cache[mod.Slug]
state := config.ModState{}
if compatible != nil {
@@ -133,15 +137,15 @@ func checkMods(cfg *config.Config, client *modrinth.Client) report {
if latest != nil {
state.Latest = latest.ID
}
- newCache[slug] = state
+ newCache[mod.Slug] = state
switch {
case compatible == nil:
- rep.noCompatible = append(rep.noCompatible, slug)
+ rep.noCompatible = append(rep.noCompatible, mod.Slug)
case cached.Compatible == "":
- rep.newlyCompatible = append(rep.newlyCompatible, slug)
+ rep.newlyCompatible = append(rep.newlyCompatible, mod.Slug)
case latest != nil && latest.ID != cached.Latest:
- rep.stillCompatibleUpdate = append(rep.stillCompatibleUpdate, slug)
+ rep.stillCompatibleUpdate = append(rep.stillCompatibleUpdate, mod.Slug)
}
}