From 1318fffeb66a701f9d8b88d76a265dd5f2854fbb Mon Sep 17 00:00:00 2001 From: IoIxD Date: Tue, 23 Jul 2024 14:50:49 -0700 Subject: [PATCH] fix sitemap --- sitemap.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sitemap.go b/sitemap.go index ae1f8bf..1fac52d 100755 --- a/sitemap.go +++ b/sitemap.go @@ -132,13 +132,7 @@ func (s *server) writeSitemap() error { if forum.Type != discord.GuildForum { continue } - parent, err := s.channel(forum.ParentID) - if err != nil { - continue - } - if parent.Type != discord.GuildForum { - continue - } + perms := discord.CalcOverwrites(guild, forum, *memberSelf) if !perms.Has(0 | discord.PermissionReadMessageHistory | @@ -155,6 +149,13 @@ func (s *server) writeSitemap() error { if post.Type != discord.GuildPublicThread { continue } + parent, err := s.channel(post.ParentID) + if err != nil { + continue + } + if parent.Type != discord.GuildForum { + continue + } if err = encode(URL{ Location: fmt.Sprintf("%s/%s/%s/%s", s.URL, guild.ID, post.ParentID, post.ID), }); err != nil {