Skip to content

Commit

Permalink
fix sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
IoIxD committed Jul 23, 2024
1 parent bf89845 commit 1318fff
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions sitemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 {
Expand Down

0 comments on commit 1318fff

Please sign in to comment.