major bug fixes & breaking change in database code
Major bug fixes and improvements have been made. There's also a breaking change for plugins using the database system. All database related functions are now async based.
This commit is contained in:
@@ -38,14 +38,15 @@ export const loadAllPermissions = async () => {
|
||||
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",[
|
||||
{key:"roleid",value:admin}
|
||||
])
|
||||
|
||||
openticket.permissions.add(new api.ODPermission("openticket:ticket-admin_"+ticket.id.value+"_"+admin,"channel-role","support",role,channel))
|
||||
})
|
||||
}
|
||||
}catch(err){
|
||||
process.emit("uncaughtException",err)
|
||||
openticket.log("Ticket Admin Loading Permissions Error (see above)","error")
|
||||
|
||||
Reference in New Issue
Block a user