fixed parent permission problem;

This commit is contained in:
naudachu 2024-02-01 21:03:08 +05:00
parent d599eb9825
commit b2850d668a
2 changed files with 9 additions and 3 deletions

View File

@ -607,10 +607,16 @@ func (h *Handler) CreateProject(s *discordgo.Session, i *discordgo.InteractionCr
return
}
// Edit created channel:
parent, err := s.Channel(h.conf.IsProjectChannel)
if err != nil {
log.Printf("get project as channel object failed: %v", err)
}
// Edit created channel (new key needed, so use to make edit after creation)
edit := discordgo.ChannelEdit{
Name: p.Key + "-" + helpers.Cut(projectTitle),
ParentID: h.conf.IsProjectChannel,
Name: p.Key + "-" + helpers.Cut(projectTitle),
ParentID: h.conf.IsProjectChannel,
PermissionOverwrites: parent.PermissionOverwrites,
}
dchan, err = s.ChannelEdit(dchan.ID, &edit)

Binary file not shown.