From 2aef85590252704bde12d8d4d127a1a2ea393181 Mon Sep 17 00:00:00 2001 From: DJj123dj <80536295+DJj123dj@users.noreply.github.com> Date: Sun, 12 Oct 2025 22:18:38 +0200 Subject: [PATCH] Started working on channel topic again --- src/actions/createTicket.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/actions/createTicket.ts b/src/actions/createTicket.ts index 1d05f8f..d3a63ac 100644 --- a/src/actions/createTicket.ts +++ b/src/actions/createTicket.ts @@ -19,7 +19,7 @@ export const registerActions = async () => { const channelPrefix = option.get("opendiscord:channel-prefix").value const channelCategory = option.get("opendiscord:channel-category").value const channelBackupCategory = option.get("opendiscord:channel-category-backup").value - const channelTopic = option.get("opendiscord:channel-topic").value + const channelTopicText = option.get("opendiscord:channel-topic").value const channelSuffix = await opendiscord.options.suffix.getSuffixFromOption(option,user,guild) const channelName = channelPrefix+channelSuffix @@ -58,6 +58,12 @@ export const registerActions = async () => { } } + //handle channel topic + const channelTopics: string[] = [] + if (generalConfig.data.system.channelTopic.showOptionTopic) channelTopics.push(channelTopicText) + if (generalConfig.data.system.channelTopic.showCreator) channelTopics.push(discord.userMention(user.id)) + //if (generalConfig.data.system.channelTopic.showClaimed) TODO TODO TODO + //handle permissions const permissions: discord.OverwriteResolvable[] = [{ type:discord.OverwriteType.Role, @@ -110,7 +116,7 @@ export const registerActions = async () => { type:discord.ChannelType.GuildText, name:channelName, nsfw:false, - topic:channelTopic, + topic:(channelTopics.length > 0) ? channelTopics.join(" | ") : undefined, parent:category, reason:"Ticket Created By "+user.displayName, permissionOverwrites:permissions,