(v4.2.0) Reworked ticket category logic

This commit is contained in:
DJj123dj
2026-05-15 12:30:14 +02:00
parent 0c45a0ad6a
commit 15ff345948
13 changed files with 258 additions and 215 deletions
+25 -1
View File
@@ -336,7 +336,7 @@ const errorEmbeds = () => {
instance.setTitle(utilities.emojiTitle("❌",lang.getTranslation("errors.titles.channelRename")))
instance.setAuthor(user.displayName,user.displayAvatarURL())
instance.setDescription(lang.getTranslation("errors.descriptions.channelRename"))
instance.setFooter(lang.getTranslationWithParams("errors.descriptions.channelRenameOrigin",[method]))
instance.setFooter(lang.getTranslationWithParams("errors.descriptions.channelRenameSource",[method]))
instance.addFields(
{name:lang.getTranslation("params.uppercase.originalName")+":",value:"```#"+originalName+"```",inline:false},
{name:lang.getTranslation("params.uppercase.newName")+":",value:"```#"+newName+"```",inline:false}
@@ -344,6 +344,30 @@ const errorEmbeds = () => {
})
)
//ERROR CHANNEL CATEGORY
embeds.add(new api.ODEmbed("opendiscord:error-channel-category"))
embeds.get("opendiscord:error-channel-category").workers.add(
new api.ODWorker("opendiscord:error-channel-category",0,async (instance,params,origin) => {
const {channel,user,originalCategory,newCategory} = params
const method = (origin == "ticket-create" || origin == "ticket-close" || origin == "ticket-reopen" || origin == "ticket-claim" || origin == "ticket-unclaim" || origin == "ticket-move") ? origin : getMethodFromOrigin(origin)
instance.setColor(generalConfig.data.system.useRedErrorEmbeds ? "Red" : generalConfig.data.mainColor)
//TODO TRANSLATION!!!
instance.setTitle(utilities.emojiTitle("❌","Unable To Change Category"))
instance.setAuthor(user.displayName,user.displayAvatarURL())
//TODO TRANSLATION!!!
instance.setDescription("Due to Discord rate limits, the channel category could not be changed immediately. It will be changed automatically within 10 minutes if the bot remains online.")
instance.setFooter(lang.getTranslationWithParams("errors.descriptions.channelRenameSource",[method]))
instance.addFields(
//TODO TRANSLATION!!!
{name:"Original Category"+":",value:"```"+originalCategory+"```",inline:false},
//TODO TRANSLATION!!!
{name:"New Category"+":",value:"```"+newCategory+"```",inline:false}
)
})
)
//ERROR TICKET BUSY
embeds.add(new api.ODEmbed("opendiscord:error-ticket-busy"))
embeds.get("opendiscord:error-ticket-busy").workers.add(
+10
View File
@@ -178,6 +178,16 @@ const errorMessages = () => {
})
)
//ERROR CHANNEL CATEGORY
messages.add(new api.ODMessage("opendiscord:error-channel-category"))
messages.get("opendiscord:error-channel-category").workers.add(
new api.ODWorker("opendiscord:error-channel-category",0,async (instance,params,origin) => {
const {guild,channel,user,originalCategory,newCategory} = params
instance.addEmbed(await embeds.getSafe("opendiscord:error-channel-category").build(origin,{guild,channel,user,originalCategory,newCategory}))
instance.setEphemeral(true)
})
)
//ERROR TICKET BUSY
messages.add(new api.ODMessage("opendiscord:error-ticket-busy"))
messages.get("opendiscord:error-ticket-busy").workers.add(