Added all the new config variables for v4.1.0!
This commit is contained in:
@@ -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 channelDescription = option.get("opendiscord:channel-description").value
|
||||
const channelTopic = option.get("opendiscord:channel-topic").value
|
||||
const channelSuffix = await opendiscord.options.suffix.getSuffixFromOption(option,user)
|
||||
const channelName = channelPrefix+channelSuffix
|
||||
|
||||
@@ -108,7 +108,7 @@ export const registerActions = async () => {
|
||||
type:discord.ChannelType.GuildText,
|
||||
name:channelName,
|
||||
nsfw:false,
|
||||
topic:channelDescription,
|
||||
topic:channelTopic,
|
||||
parent:category,
|
||||
reason:"Ticket Created By "+user.displayName,
|
||||
permissionOverwrites:permissions
|
||||
@@ -131,6 +131,7 @@ export const registerActions = async () => {
|
||||
new api.ODTicketData("opendiscord:ticket-message",null),
|
||||
new api.ODTicketData("opendiscord:participants",participants),
|
||||
new api.ODTicketData("opendiscord:channel-suffix",channelSuffix),
|
||||
new api.ODTicketData("opendiscord:previous-creators",[]),
|
||||
|
||||
new api.ODTicketData("opendiscord:open",true),
|
||||
new api.ODTicketData("opendiscord:opened-by",user.id),
|
||||
@@ -138,6 +139,9 @@ export const registerActions = async () => {
|
||||
new api.ODTicketData("opendiscord:closed",false),
|
||||
new api.ODTicketData("opendiscord:closed-by",null),
|
||||
new api.ODTicketData("opendiscord:closed-on",null),
|
||||
new api.ODTicketData("opendiscord:reopened",false),
|
||||
new api.ODTicketData("opendiscord:reopened-by",null),
|
||||
new api.ODTicketData("opendiscord:reopened-on",null),
|
||||
new api.ODTicketData("opendiscord:claimed",false),
|
||||
new api.ODTicketData("opendiscord:claimed-by",null),
|
||||
new api.ODTicketData("opendiscord:claimed-on",null),
|
||||
@@ -155,7 +159,11 @@ export const registerActions = async () => {
|
||||
new api.ODTicketData("opendiscord:autodelete-enabled",option.get("opendiscord:autodelete-enable-days").value),
|
||||
new api.ODTicketData("opendiscord:autodelete-days",(option.get("opendiscord:autodelete-enable-days").value ? option.get("opendiscord:autodelete-days").value : 0)),
|
||||
|
||||
new api.ODTicketData("opendiscord:answers",answers)
|
||||
new api.ODTicketData("opendiscord:answers",answers),
|
||||
new api.ODTicketData("opendiscord:priority",-1),
|
||||
new api.ODTicketData("opendiscord:topic",option.get("opendiscord:channel-topic").value),
|
||||
new api.ODTicketData("opendiscord:message-sent",false),
|
||||
new api.ODTicketData("opendiscord:admin-message-sent",false),
|
||||
])
|
||||
|
||||
//manage stats
|
||||
|
||||
@@ -28,7 +28,7 @@ export const registerActions = async () => {
|
||||
const rawClaimCategory = ticket.option.get("opendiscord:channel-categories-claimed").value.find((c) => c.user == user.id)
|
||||
const claimCategory = (rawClaimCategory) ? rawClaimCategory.category : null
|
||||
const closeCategory = ticket.option.get("opendiscord:channel-category-closed").value
|
||||
const channelDescription = ticket.option.get("opendiscord:channel-description").value
|
||||
const channelTopic = ticket.option.get("opendiscord:channel-topic").value
|
||||
const channelName = channelPrefix+channelSuffix
|
||||
|
||||
//handle category
|
||||
@@ -164,7 +164,7 @@ export const registerActions = async () => {
|
||||
await channel.send((await opendiscord.builders.messages.getSafe("opendiscord:error-channel-rename").build("ticket-move",{guild,channel,user,originalName,newName:channelName})).message)
|
||||
}
|
||||
try{
|
||||
if (channel.type == discord.ChannelType.GuildText) channel.setTopic(channelDescription)
|
||||
if (channel.type == discord.ChannelType.GuildText) channel.setTopic(channelTopic)
|
||||
}catch{}
|
||||
|
||||
//update ticket message
|
||||
|
||||
@@ -88,13 +88,13 @@ export const registerActions = async () => {
|
||||
if (!instance.role || !instance.result) return
|
||||
|
||||
//to logs
|
||||
if (generalConfig.data.system.logs.enabled && (generalConfig.data.system.messages.roleAdding.logs || generalConfig.data.system.messages.roleRemoving.logs)){
|
||||
if (generalConfig.data.system.logs.enabled && (generalConfig.data.system.messages.reactionRole.logs)){
|
||||
const logChannel = opendiscord.posts.get("opendiscord:logs")
|
||||
if (logChannel) logChannel.send(await opendiscord.builders.messages.getSafe("opendiscord:reaction-role-logs").build(source,{guild,user,role:instance.role,result:instance.result}))
|
||||
}
|
||||
|
||||
//to dm
|
||||
if (generalConfig.data.system.messages.roleAdding.dm || generalConfig.data.system.messages.roleRemoving.dm) await opendiscord.client.sendUserDm(user,await opendiscord.builders.messages.getSafe("opendiscord:reaction-role-dm").build(source,{guild,user,role:instance.role,result:instance.result}))
|
||||
if (generalConfig.data.system.messages.reactionRole.dm) await opendiscord.client.sendUserDm(user,await opendiscord.builders.messages.getSafe("opendiscord:reaction-role-dm").build(source,{guild,user,role:instance.role,result:instance.result}))
|
||||
}),
|
||||
new api.ODWorker("opendiscord:logs",0,(instance,params,source,cancel) => {
|
||||
const {guild,user,option} = params
|
||||
|
||||
Reference in New Issue
Block a user