From 1717ddb30fea7bf26806113005e62ae17b6ca6b4 Mon Sep 17 00:00:00 2001 From: MCorange Date: Tue, 17 Feb 2026 21:38:06 +0200 Subject: [PATCH] Add simple thread support for forums --- commands.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index 88b737c..12676aa 100644 --- a/commands.go +++ b/commands.go @@ -706,8 +706,24 @@ func fnBridge(ce *WrappedCommandEvent) { } portal := ce.User.GetExistingPortalByID(channelID) if portal == nil { - ce.Reply("Channel not found") - return + // HACK: Before giving up, discover if the user is trying to join a + // thread. Then, cause the creation of a portal. + // This is for forum channel threads; they don't show up on the + // forum channels. + ch, err := ce.User.Session.Channel(channelID) + if err != nil { + ce.Reply("Channel not found") + return + } + + if ch.Type != discordgo.ChannelTypeGuildPublicThread && + ch.Type != discordgo.ChannelTypeGuildPrivateThread { + return + } + + ce.ZLog.Debug().Msg("Adding public / private thread as a portal") + portal = ce.User.GetPortalByID(channelID, ch.Type) + } portal.roomCreateLock.Lock() defer portal.roomCreateLock.Unlock()