BREAKING: changed all ids to "opendiscord:"
This commit is contained in:
+67
-67
@@ -4,26 +4,26 @@
|
||||
import {opendiscord, api, utilities} from "../index"
|
||||
import * as discord from "discord.js"
|
||||
|
||||
const generalConfig = opendiscord.configs.get("openticket:general")
|
||||
const generalConfig = opendiscord.configs.get("opendiscord:general")
|
||||
|
||||
export const registerActions = async () => {
|
||||
opendiscord.actions.add(new api.ODAction("openticket:pin-ticket"))
|
||||
opendiscord.actions.get("openticket:pin-ticket").workers.add([
|
||||
new api.ODWorker("openticket:pin-ticket",2,async (instance,params,source,cancel) => {
|
||||
opendiscord.actions.add(new api.ODAction("opendiscord:pin-ticket"))
|
||||
opendiscord.actions.get("opendiscord:pin-ticket").workers.add([
|
||||
new api.ODWorker("opendiscord:pin-ticket",2,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user,ticket,reason} = params
|
||||
if (channel.isThread()) throw new api.ODSystemError("Unable to pin ticket! Open Ticket doesn't support threads!")
|
||||
|
||||
await opendiscord.events.get("onTicketPin").emit([ticket,user,channel,reason])
|
||||
|
||||
//update ticket
|
||||
ticket.get("openticket:pinned").value = true
|
||||
ticket.get("openticket:pinned-by").value = user.id
|
||||
ticket.get("openticket:pinned-on").value = new Date().getTime()
|
||||
ticket.get("openticket:busy").value = true
|
||||
ticket.get("opendiscord:pinned").value = true
|
||||
ticket.get("opendiscord:pinned-by").value = user.id
|
||||
ticket.get("opendiscord:pinned-on").value = new Date().getTime()
|
||||
ticket.get("opendiscord:busy").value = true
|
||||
|
||||
//update stats
|
||||
await opendiscord.stats.get("openticket:global").setStat("openticket:tickets-pinned",1,"increase")
|
||||
await opendiscord.stats.get("openticket:user").setStat("openticket:tickets-pinned",user.id,1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:global").setStat("opendiscord:tickets-pinned",1,"increase")
|
||||
await opendiscord.stats.get("opendiscord:user").setStat("opendiscord:tickets-pinned",user.id,1,"increase")
|
||||
|
||||
//move to top of category
|
||||
if (channel.parent){
|
||||
@@ -38,14 +38,14 @@ export const registerActions = async () => {
|
||||
opendiscord.log("Failed to rename channel on ticket pin","error")
|
||||
})
|
||||
}catch(err){
|
||||
await channel.send((await opendiscord.builders.messages.getSafe("openticket:error-channel-rename").build("ticket-pin",{guild,channel,user,originalName,newName})).message)
|
||||
await channel.send((await opendiscord.builders.messages.getSafe("opendiscord:error-channel-rename").build("ticket-pin",{guild,channel,user,originalName,newName})).message)
|
||||
}
|
||||
|
||||
//update ticket message
|
||||
const ticketMessage = await opendiscord.tickets.getTicketMessage(ticket)
|
||||
if (ticketMessage){
|
||||
try{
|
||||
ticketMessage.edit((await opendiscord.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||
ticketMessage.edit((await opendiscord.builders.messages.getSafe("opendiscord:ticket-message").build("other",{guild,channel,user,ticket})).message)
|
||||
}catch(e){
|
||||
opendiscord.log("Unable to edit ticket message on ticket pinning!","error",[
|
||||
{key:"channel",value:"#"+channel.name},
|
||||
@@ -58,24 +58,24 @@ export const registerActions = async () => {
|
||||
}
|
||||
|
||||
//reply with new message
|
||||
if (params.sendMessage) await channel.send((await opendiscord.builders.messages.getSafe("openticket:pin-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||
ticket.get("openticket:busy").value = false
|
||||
if (params.sendMessage) await channel.send((await opendiscord.builders.messages.getSafe("opendiscord:pin-message").build(source,{guild,channel,user,ticket,reason})).message)
|
||||
ticket.get("opendiscord:busy").value = false
|
||||
await opendiscord.events.get("afterTicketPinned").emit([ticket,user,channel,reason])
|
||||
}),
|
||||
new api.ODWorker("openticket:discord-logs",1,async (instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:discord-logs",1,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user,ticket,reason} = params
|
||||
|
||||
//to logs
|
||||
if (generalConfig.data.system.logs.enabled && generalConfig.data.system.messages.pinning.logs){
|
||||
const logChannel = opendiscord.posts.get("openticket:logs")
|
||||
if (logChannel) logChannel.send(await opendiscord.builders.messages.getSafe("openticket:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||
const logChannel = opendiscord.posts.get("opendiscord:logs")
|
||||
if (logChannel) logChannel.send(await opendiscord.builders.messages.getSafe("opendiscord:ticket-action-logs").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||
}
|
||||
|
||||
//to dm
|
||||
const creator = await opendiscord.tickets.getTicketUser(ticket,"creator")
|
||||
if (creator && generalConfig.data.system.messages.pinning.dm) await opendiscord.client.sendUserDm(creator,await opendiscord.builders.messages.getSafe("openticket:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||
if (creator && generalConfig.data.system.messages.pinning.dm) await opendiscord.client.sendUserDm(creator,await opendiscord.builders.messages.getSafe("opendiscord:ticket-action-dm").build(source,{guild,channel,user,ticket,mode:"pin",reason,additionalData:null}))
|
||||
}),
|
||||
new api.ODWorker("openticket:logs",0,(instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:logs",0,(instance,params,source,cancel) => {
|
||||
const {guild,channel,user,ticket} = params
|
||||
|
||||
opendiscord.log(user.displayName+" pinned a ticket!","info",[
|
||||
@@ -92,184 +92,184 @@ export const registerActions = async () => {
|
||||
|
||||
export const registerVerifyBars = async () => {
|
||||
//PIN TICKET TICKET MESSAGE
|
||||
opendiscord.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-ticket-message",opendiscord.builders.messages.getSafe("openticket:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||
opendiscord.verifybars.get("openticket:pin-ticket-ticket-message").success.add([
|
||||
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||
opendiscord.verifybars.add(new api.ODVerifyBar("opendiscord:pin-ticket-ticket-message",opendiscord.builders.messages.getSafe("opendiscord:verifybar-ticket-message"),!generalConfig.data.system.disableVerifyBars))
|
||||
opendiscord.verifybars.get("opendiscord:pin-ticket-ticket-message").success.add([
|
||||
new api.ODWorker("opendiscord:permissions",1,async (instance,params,source,cancel) => {
|
||||
const permissionMode = generalConfig.data.system.permissions.pin
|
||||
|
||||
if (permissionMode == "none"){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
return cancel()
|
||||
}else if (permissionMode == "everyone") return
|
||||
else if (permissionMode == "admin"){
|
||||
if (!opendiscord.permissions.hasPermissions("support",await opendiscord.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||
return cancel()
|
||||
}else return
|
||||
}else{
|
||||
if (!instance.guild || !instance.member){
|
||||
//error
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||
return cancel()
|
||||
}
|
||||
const role = await opendiscord.client.fetchGuildRole(instance.guild,permissionMode)
|
||||
if (!role){
|
||||
//error
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||
return cancel()
|
||||
}
|
||||
if (!role.members.has(instance.member.id)){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
return cancel()
|
||||
}else return
|
||||
}
|
||||
}),
|
||||
new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user} = instance
|
||||
if (!guild){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-not-in-guild").build("button",{channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
const ticket = opendiscord.tickets.get(channel.id)
|
||||
if (!ticket || channel.isDMBased()){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
//return when already pinned
|
||||
if (ticket.get("openticket:pinned").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||
if (ticket.get("opendiscord:pinned").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||
return cancel()
|
||||
}
|
||||
//return when busy
|
||||
if (ticket.get("openticket:busy").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||
if (ticket.get("opendiscord:busy").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-busy").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
|
||||
//start pinning ticket
|
||||
if (params.data == "reason"){
|
||||
//pin with reason
|
||||
instance.modal(await opendiscord.builders.modals.getSafe("openticket:pin-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||
instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:pin-ticket-reason").build("ticket-message",{guild,channel,user,ticket}))
|
||||
}else{
|
||||
//pin without reason
|
||||
await instance.defer("update",false)
|
||||
await opendiscord.actions.get("openticket:pin-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||
await opendiscord.actions.get("opendiscord:pin-ticket").run("ticket-message",{guild,channel,user,ticket,reason:null,sendMessage:true})
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("opendiscord:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||
}
|
||||
})
|
||||
])
|
||||
opendiscord.verifybars.get("openticket:pin-ticket-ticket-message").failure.add([
|
||||
new api.ODWorker("openticket:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||
opendiscord.verifybars.get("opendiscord:pin-ticket-ticket-message").failure.add([
|
||||
new api.ODWorker("opendiscord:back-to-ticket-message",0,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user} = instance
|
||||
if (!guild){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-not-in-guild").build("button",{channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
const ticket = opendiscord.tickets.get(channel.id)
|
||||
if (!ticket || channel.isDMBased()){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("openticket:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("opendiscord:ticket-message").build("other",{guild,channel,user,ticket}))
|
||||
})
|
||||
])
|
||||
|
||||
//PIN TICKET UNPIN MESSAGE
|
||||
opendiscord.verifybars.add(new api.ODVerifyBar("openticket:pin-ticket-unpin-message",opendiscord.builders.messages.getSafe("openticket:verifybar-unpin-message"),!generalConfig.data.system.disableVerifyBars))
|
||||
opendiscord.verifybars.get("openticket:pin-ticket-unpin-message").success.add([
|
||||
new api.ODWorker("openticket:permissions",1,async (instance,params,source,cancel) => {
|
||||
opendiscord.verifybars.add(new api.ODVerifyBar("opendiscord:pin-ticket-unpin-message",opendiscord.builders.messages.getSafe("opendiscord:verifybar-unpin-message"),!generalConfig.data.system.disableVerifyBars))
|
||||
opendiscord.verifybars.get("opendiscord:pin-ticket-unpin-message").success.add([
|
||||
new api.ODWorker("opendiscord:permissions",1,async (instance,params,source,cancel) => {
|
||||
const permissionMode = generalConfig.data.system.permissions.pin
|
||||
|
||||
if (permissionMode == "none"){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
return cancel()
|
||||
}else if (permissionMode == "everyone") return
|
||||
else if (permissionMode == "admin"){
|
||||
if (!opendiscord.permissions.hasPermissions("support",await opendiscord.permissions.getPermissions(instance.user,instance.channel,instance.guild))){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:["support"]}))
|
||||
return cancel()
|
||||
}else return
|
||||
}else{
|
||||
if (!instance.guild || !instance.member){
|
||||
//error
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #1",layout:"advanced"}))
|
||||
return cancel()
|
||||
}
|
||||
const role = await opendiscord.client.fetchGuildRole(instance.guild,permissionMode)
|
||||
if (!role){
|
||||
//error
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,error:"Permission Error: Not in Server #2",layout:"advanced"}))
|
||||
return cancel()
|
||||
}
|
||||
if (!role.members.has(instance.member.id)){
|
||||
//no permissions
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-no-permissions").build("button",{guild:instance.guild,channel:instance.channel,user:instance.user,permissions:[]}))
|
||||
return cancel()
|
||||
}else return
|
||||
}
|
||||
}),
|
||||
new api.ODWorker("openticket:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||
new api.ODWorker("opendiscord:pin-ticket",0,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user} = instance
|
||||
if (!guild){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-not-in-guild").build("button",{channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
const ticket = opendiscord.tickets.get(channel.id)
|
||||
if (!ticket || channel.isDMBased()){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
//return when already pinned
|
||||
if (ticket.get("openticket:pinned").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||
if (ticket.get("opendiscord:pinned").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error").build("button",{guild,channel,user,error:opendiscord.languages.getTranslation("errors.actionInvalid.pin"),layout:"simple"}))
|
||||
return cancel()
|
||||
}
|
||||
//return when busy
|
||||
if (ticket.get("openticket:busy").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-busy").build("button",{guild,channel,user}))
|
||||
if (ticket.get("opendiscord:busy").value){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-busy").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
|
||||
//start pinning ticket
|
||||
if (params.data == "reason"){
|
||||
//pin with reason
|
||||
instance.modal(await opendiscord.builders.modals.getSafe("openticket:pin-ticket-reason").build("unpin-message",{guild,channel,user,ticket}))
|
||||
instance.modal(await opendiscord.builders.modals.getSafe("opendiscord:pin-ticket-reason").build("unpin-message",{guild,channel,user,ticket}))
|
||||
}else{
|
||||
//pin without reason
|
||||
await instance.defer("update",false)
|
||||
await opendiscord.actions.get("openticket:pin-ticket").run("unpin-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("openticket:pin-message").build("unpin-message",{guild,channel,user,ticket,reason:null}))
|
||||
await opendiscord.actions.get("opendiscord:pin-ticket").run("unpin-message",{guild,channel,user,ticket,reason:null,sendMessage:false})
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("opendiscord:pin-message").build("unpin-message",{guild,channel,user,ticket,reason:null}))
|
||||
}
|
||||
})
|
||||
])
|
||||
opendiscord.verifybars.get("openticket:pin-ticket-unpin-message").failure.add([
|
||||
new api.ODWorker("openticket:back-to-unpin-message",0,async (instance,params,source,cancel) => {
|
||||
opendiscord.verifybars.get("opendiscord:pin-ticket-unpin-message").failure.add([
|
||||
new api.ODWorker("opendiscord:back-to-unpin-message",0,async (instance,params,source,cancel) => {
|
||||
const {guild,channel,user} = instance
|
||||
const {verifybarMessage} = params
|
||||
if (!guild){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-not-in-guild").build("button",{channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-not-in-guild").build("button",{channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
const ticket = opendiscord.tickets.get(channel.id)
|
||||
if (!ticket || channel.isDMBased()){
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("openticket:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
instance.reply(await opendiscord.builders.messages.getSafe("opendiscord:error-ticket-unknown").build("button",{guild,channel,user}))
|
||||
return cancel()
|
||||
}
|
||||
|
||||
const rawReason = (verifybarMessage && verifybarMessage.embeds[0] && verifybarMessage.embeds[0].fields[0]) ? verifybarMessage.embeds[0].fields[0].value : null
|
||||
const reason = (rawReason == null) ? null : rawReason.substring(3,rawReason.length-3)
|
||||
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("openticket:unpin-message").build("other",{guild,channel,user,ticket,reason}))
|
||||
await instance.update(await opendiscord.builders.messages.getSafe("opendiscord:unpin-message").build("other",{guild,channel,user,ticket,reason}))
|
||||
})
|
||||
])
|
||||
opendiscord.actions.get("openticket:pin-ticket").workers.backupWorker = new api.ODWorker("openticket:cancel-busy",0,(instance,params) => {
|
||||
opendiscord.actions.get("opendiscord:pin-ticket").workers.backupWorker = new api.ODWorker("opendiscord:cancel-busy",0,(instance,params) => {
|
||||
//set busy to false in case of crash or cancel
|
||||
params.ticket.get("openticket:busy").value = false
|
||||
params.ticket.get("opendiscord:busy").value = false
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user