WIP: feature: threads'n'forums #74

Draft
Guzio wants to merge 109 commits from Guzio/out-of-your-element:mergable-fr-fr into main
Showing only changes of commit 1cc86b52fd - Show all commits

View file

@ -54,7 +54,7 @@ function convertNameAndTopic(channel, guild, customName) {
// @ts-ignore // @ts-ignore
const parentChannel = discord.channels.get(channel.parent_id) const parentChannel = discord.channels.get(channel.parent_id)
let channelPrefix = let channelPrefix =
( parentChannel?.type === DiscordTypes.ChannelType.GuildForum ? "" ( parentChannel?.type === DiscordTypes.ChannelType.GuildForum ? "[❓] "
: channel.type === DiscordTypes.ChannelType.PublicThread ? "[⛓️] " : channel.type === DiscordTypes.ChannelType.PublicThread ? "[⛓️] "
: channel.type === DiscordTypes.ChannelType.AnnouncementThread ? "[⛓️] " : channel.type === DiscordTypes.ChannelType.AnnouncementThread ? "[⛓️] "
: channel.type === DiscordTypes.ChannelType.PrivateThread ? "[🔒⛓️] " : channel.type === DiscordTypes.ChannelType.PrivateThread ? "[🔒⛓️] "
@ -65,10 +65,11 @@ function convertNameAndTopic(channel, guild, customName) {
const maybeTopicWithNewlines = channel.topic ? `${channel.topic}\n\n` : ''; const maybeTopicWithNewlines = channel.topic ? `${channel.topic}\n\n` : '';
const channelIDPart = `Channel ID: ${channel.id}`; const channelIDPart = `Channel ID: ${channel.id}`;
const guildIDPart = `Guild ID: ${guild.id}`; const guildIDPart = `Guild ID: ${guild.id}`;
const maybeThreadWithinPart = parentChannel ? `Thread within: ${parentChannel.name} (ID: ${parentChannel.id})\n` : '';
const convertedTopic = customName const convertedTopic = customName
? `#${channel.name}${maybeTopicWithPipe}\n\n${channelIDPart}\n${guildIDPart}` ? `#${channel.name}${maybeTopicWithPipe}\n\n${channelIDPart}\n${maybeThreadWithinPart}${guildIDPart}`
: `${maybeTopicWithNewlines}${channelIDPart}\n${guildIDPart}`; : `${maybeTopicWithNewlines}${channelIDPart}\n${maybeThreadWithinPart}${guildIDPart}`;
return [chosenName, convertedTopic]; return [chosenName, convertedTopic];
} }