Fixed all currently known bugs :)
This commit is contained in:
@@ -296,7 +296,7 @@ export const loadPanelAutoUpdateCode = async () => {
|
||||
const channel = await openticket.client.fetchGuildTextChannel(mainServer,splittedId[0])
|
||||
if (!channel) return
|
||||
const message = await openticket.client.fetchGuildChannelMessage(mainServer,channel,splittedId[1])
|
||||
if (!message) return
|
||||
if (!message || !message.editable) return
|
||||
|
||||
message.edit((await openticket.builders.messages.getSafe("openticket:panel").build("auto-update",{guild:mainServer,channel,user:openticket.client.client.user,panel})).message)
|
||||
openticket.log("Panel in server got auto-updated!","info",[
|
||||
|
||||
@@ -62,7 +62,7 @@ export const addTicketPermissions = async (ticket:api.ODTicket) => {
|
||||
const admins = ticket.option.exists("openticket:admins") ? ticket.option.get("openticket:admins").value : []
|
||||
const readAdmins = ticket.option.exists("openticket:admins-readonly") ? ticket.option.get("openticket:admins-readonly").value : []
|
||||
|
||||
admins.concat(readAdmins).forEach(async (admin) => {
|
||||
for (const admin of admins.concat(readAdmins)){
|
||||
if (openticket.permissions.exists("openticket:ticket-admin_"+ticket.id.value+"_"+admin)) return
|
||||
const role = await mainServer.roles.fetch(admin)
|
||||
if (!role) return openticket.log("Unable to register permission for ticket admin!","error",[
|
||||
@@ -70,7 +70,7 @@ export const addTicketPermissions = async (ticket:api.ODTicket) => {
|
||||
])
|
||||
|
||||
openticket.permissions.add(new api.ODPermission("openticket:ticket-admin_"+ticket.id.value+"_"+admin,"channel-role","support",role,channel))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const removeTicketPermissions = async (ticket:api.ODTicket) => {
|
||||
|
||||
Reference in New Issue
Block a user