Started working on channel topic again

This commit is contained in:
DJj123dj
2025-10-12 22:18:38 +02:00
parent 4aacdd1607
commit 2aef855902
+8 -2
View File
@@ -19,7 +19,7 @@ export const registerActions = async () => {
const channelPrefix = option.get("opendiscord:channel-prefix").value const channelPrefix = option.get("opendiscord:channel-prefix").value
const channelCategory = option.get("opendiscord:channel-category").value const channelCategory = option.get("opendiscord:channel-category").value
const channelBackupCategory = option.get("opendiscord:channel-category-backup").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 channelSuffix = await opendiscord.options.suffix.getSuffixFromOption(option,user,guild)
const channelName = channelPrefix+channelSuffix 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 //handle permissions
const permissions: discord.OverwriteResolvable[] = [{ const permissions: discord.OverwriteResolvable[] = [{
type:discord.OverwriteType.Role, type:discord.OverwriteType.Role,
@@ -110,7 +116,7 @@ export const registerActions = async () => {
type:discord.ChannelType.GuildText, type:discord.ChannelType.GuildText,
name:channelName, name:channelName,
nsfw:false, nsfw:false,
topic:channelTopic, topic:(channelTopics.length > 0) ? channelTopics.join(" | ") : undefined,
parent:category, parent:category,
reason:"Ticket Created By "+user.displayName, reason:"Ticket Created By "+user.displayName,
permissionOverwrites:permissions, permissionOverwrites:permissions,